author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (side-by-side diff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kaddressbook | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
98 files changed, 1095 insertions, 882 deletions
diff --git a/kaddressbook/addresseditwidget.cpp b/kaddressbook/addresseditwidget.cpp index 3dcd592..83908d0 100644 --- a/kaddressbook/addresseditwidget.cpp +++ b/kaddressbook/addresseditwidget.cpp @@ -21,26 +21,33 @@ with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ -#include <qbuttongroup.h> +#include <q3buttongroup.h> #include <qcheckbox.h> -#include <qhbox.h> +#include <q3hbox.h> #include <qlabel.h> #include <qlayout.h> -#include <qlistbox.h> -#include <qlistview.h> +#include <q3listbox.h> +#include <q3listview.h> #include <qpushbutton.h> -#include <qsignal.h> +#include <q3signal.h> #include <qstring.h> #include <qapplication.h> +#include <QDesktopWidget> + +#include <Q3VBoxLayout> +#include <Q3GridLayout> #ifndef KAB_EMBEDDED -#include <qtextedit.h> +#include <q3textedit.h> +//Added by qt3to4: +#include <Q3ValueList> +#include <Q3VBoxLayout> #include <kaccelmanager.h> #include <kbuttonbox.h> #else //KAB_EMBEDDED -#include <qmultilineedit.h> +#include <q3multilineedit.h> #endif //KAB_EMBEDDED #include <qtoolbutton.h> #include <qtooltip.h> @@ -66,11 +73,11 @@ AddressEditWidget::AddressEditWidget( QWidget *parent, const char *name ) : QWidget( parent, name ) { mConfig = AddresseeConfig::instance(); - QVBoxLayout *layout = new QVBoxLayout( this ); + Q3VBoxLayout *layout = new Q3VBoxLayout( this ); layout->setSpacing( KDialog::spacingHintSmall() ); - QHBox *b1 = new QHBox( this); + Q3HBox *b1 = new Q3HBox( this); //QLabel * label = new QLabel( b1 ); //label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop, 0 ) ); @@ -83,13 +90,13 @@ AddressEditWidget::AddressEditWidget( QWidget *parent, const char *name ) SLOT( updateAddressEdit() ) ); // layout->addWidget( mTypeCombo ); #ifndef KAB_EMBEDDED - mAddressTextEdit = new QTextEdit( this ); + mAddressTextEdit = new Q3TextEdit( this ); mAddressTextEdit->setReadOnly( true ); mAddressTextEdit->setMinimumHeight( 20 ); #else //KAB_EMBEDDED - mAddressTextEdit = new QMultiLineEdit( this ); + mAddressTextEdit = new Q3MultiLineEdit( this ); mAddressTextEdit->setReadOnly( true ); mAddressTextEdit->setMinimumHeight( 20 ); #endif //KAB_EMBEDDED @@ -125,15 +132,15 @@ void AddressEditWidget::setAddresses( const KABC::Addressee &addr, // Insert types for existing numbers. mTypeCombo->insertTypeList( list ); - QValueList<int> defaultTypes; + Q3ValueList<int> defaultTypes; defaultTypes << KABC::Address::Home; defaultTypes << KABC::Address::Work; mConfig->setUid( mAddressee.uid() ); - QValueList<int> configList = mConfig->noDefaultAddrTypes(); - QValueList<int>::ConstIterator it; + Q3ValueList<int> configList = mConfig->noDefaultAddrTypes(); + Q3ValueList<int>::ConstIterator it; for ( it = configList.begin(); it != configList.end(); ++it ) defaultTypes.remove( *it ); // Insert default types. @@ -180,9 +187,9 @@ void AddressEditWidget::edit() } } mConfig->setUid( mAddressee.uid() ); - QValueList<int> configList; + Q3ValueList<int> configList; if ( !hasHome ) { configList << KABC::Address::Home; } if ( !hasWork ) { @@ -254,9 +261,9 @@ AddressEditDialog::AddressEditDialog( const KABC::Address::List &list, mAddressList = list; QWidget *page = plainPage(); - QGridLayout *topLayout = new QGridLayout( page, 8, 2 ); + Q3GridLayout *topLayout = new Q3GridLayout( page, 8, 2 ); topLayout->setSpacing( spacingHintSmall() ); mTypeCombo = new AddressTypeCombo( mAddressList, page ); topLayout->addMultiCellWidget( mTypeCombo, 0, 0, 0, 1 ); @@ -265,11 +272,11 @@ AddressEditDialog::AddressEditDialog( const KABC::Address::List &list, label->setAlignment( Qt::AlignTop | Qt::AlignLeft ); topLayout->addWidget( label, 1, 0 ); #ifndef KAB_EMBEDDED - mStreetTextEdit = new QTextEdit( page ); + mStreetTextEdit = new Q3TextEdit( page ); #else //KAB_EMBEDDED - mStreetTextEdit = new QMultiLineEdit( page ); + mStreetTextEdit = new Q3MultiLineEdit( page ); //US qDebug("AddressEditDialog::AddressEditDialog has to be changed"); #endif //KAB_EMBEDDED label->setBuddy( mStreetTextEdit ); @@ -310,16 +317,16 @@ AddressEditDialog::AddressEditDialog( const KABC::Address::List &list, mCountryCombo->setAutoCompletion( true ); fillCountryCombo(); label->setBuddy( mCountryCombo ); topLayout->addWidget( mCountryCombo, 6, 1 ); - mCountryCombo->setSizeLimit( 8); + mCountryCombo->setMaxVisibleItems( 8); mPreferredCheckBox = new QCheckBox( i18n( "This is the preferred address" ), page ); topLayout->addMultiCellWidget( mPreferredCheckBox, 7, 7, 0, 1 ); /* KSeparator *sep = new KSeparator( KSeparator::HLine, page ); topLayout->addMultiCellWidget( sep, 8, 8, 0, 1 ); */ - QHBox *buttonBox = new QHBox( page ); + Q3HBox *buttonBox = new Q3HBox( page ); buttonBox->setSpacing( spacingHint() ); topLayout->addMultiCellWidget( buttonBox, 9, 9, 0, 1 ); QPushButton *addButton = new QPushButton( i18n( "New..." ), buttonBox ); @@ -582,11 +589,11 @@ AddressTypeDialog::AddressTypeDialog( int type, QWidget *parent ) : KDialogBase( Plain, i18n( "Edit Address Type" ), Ok | Cancel, Ok, parent, "AddressTypeDialog" ) { QWidget *page = plainPage(); - QVBoxLayout *layout = new QVBoxLayout( page ); + Q3VBoxLayout *layout = new Q3VBoxLayout( page ); - mGroup = new QButtonGroup( 2, Horizontal, i18n( "Address Types" ), page ); + mGroup = new Q3ButtonGroup( 2, Qt::Horizontal, i18n( "Address Types" ), page ); layout->addWidget( mGroup ); mTypeList = KABC::Address::typeList(); mTypeList.remove( KABC::Address::Pref ); @@ -616,7 +623,7 @@ int AddressTypeDialog::type() const return type; } -#ifndef KAB_EMBEDDED -#include "addresseditwidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_addresseditwidget.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/addresseditwidget.h b/kaddressbook/addresseditwidget.h index bc96d74..1d4e138 100644 --- a/kaddressbook/addresseditwidget.h +++ b/kaddressbook/addresseditwidget.h @@ -32,15 +32,15 @@ #include "addresseeconfig.h" #include "typecombo.h" -class QButtonGroup; +class Q3ButtonGroup; class QCheckBox; -class QListView; +class Q3ListView; #ifndef KAB_EMBEDDED -class QTextEdit; +class Q3TextEdit; #else //KAB_EMBEDDED -class QMultiLineEdit; +class Q3MultiLineEdit; #endif //KAB_EMBEDDED class QToolButton; class KComboBox; @@ -80,11 +80,11 @@ class AddressEditWidget : public QWidget AddressTypeCombo *mTypeCombo; QPushButton *mEditButton; #ifndef KAB_EMBEDDED - QTextEdit *mAddressTextEdit; + Q3TextEdit *mAddressTextEdit; #else //KAB_EMBEDDED - QMultiLineEdit *mAddressTextEdit; + Q3MultiLineEdit *mAddressTextEdit; #endif //KAB_EMBEDDED KABC::Address::List mAddressList; KABC::Addressee mAddressee; @@ -119,11 +119,11 @@ class AddressEditDialog : public KDialogBase void fillCountryCombo(); AddressTypeCombo *mTypeCombo; #ifndef KAB_EMBEDDED - QTextEdit *mStreetTextEdit; + Q3TextEdit *mStreetTextEdit; #else //KAB_EMBEDDED - QMultiLineEdit *mStreetTextEdit; + Q3MultiLineEdit *mStreetTextEdit; #endif //KAB_EMBEDDED KComboBox *mCountryCombo; KLineEdit *mRegionEdit; KLineEdit *mLocalityEdit; @@ -150,9 +150,9 @@ class AddressTypeDialog : public KDialogBase int type() const; private: - QButtonGroup *mGroup; + Q3ButtonGroup *mGroup; KABC::Address::TypeList mTypeList; }; diff --git a/kaddressbook/addresseeconfig.cpp b/kaddressbook/addresseeconfig.cpp index ea0436f..81b1bf4 100644 --- a/kaddressbook/addresseeconfig.cpp +++ b/kaddressbook/addresseeconfig.cpp @@ -25,8 +25,10 @@ #include "kabprefs.h" //US #include <kstandarddirs.h> #include <qfileinfo.h> +//Added by qt3to4: +#include <Q3ValueList> using namespace KABC; static AddresseeConfig* extern_AddresseeConfig = 0; @@ -76,15 +78,15 @@ void AddresseeConfig::setAutomaticNameParsing( bool value ) return AddresseeConfig::config()->readBoolEntry( "AutomaticNameParsing", KABPrefs::instance()->mAutomaticNameParsing ); } -void AddresseeConfig::setNoDefaultAddrTypes( const QValueList<int> &types ) +void AddresseeConfig::setNoDefaultAddrTypes( const Q3ValueList<int> &types ) { AddresseeConfig::config()->writeEntry( "NoDefaultAddrTypes", types ); AddresseeConfig::config()->sync(); } - QValueList<int> AddresseeConfig::noDefaultAddrTypes() const + Q3ValueList<int> AddresseeConfig::noDefaultAddrTypes() const { return AddresseeConfig::config()->readIntListEntry( "NoDefaultAddrTypes" ); } diff --git a/kaddressbook/addresseeconfig.h b/kaddressbook/addresseeconfig.h index 47fbdd6..f6bb3e9 100644 --- a/kaddressbook/addresseeconfig.h +++ b/kaddressbook/addresseeconfig.h @@ -25,8 +25,10 @@ #define ADDRESSEECONFIG_H #include <kabc/addressee.h> #include <kconfig.h> +//Added by qt3to4: +#include <Q3ValueList> using namespace KABC; class AddresseeConfig @@ -42,10 +44,10 @@ class AddresseeConfig void setUid( const QString & uid ); void setAutomaticNameParsing( bool value ); bool automaticNameParsing(); - void setNoDefaultAddrTypes( const QValueList<int> &types ); - QValueList<int> noDefaultAddrTypes() const; + void setNoDefaultAddrTypes( const Q3ValueList<int> &types ); + Q3ValueList<int> noDefaultAddrTypes() const; void remove( const QString & uid); private: diff --git a/kaddressbook/addresseeeditordialog.cpp b/kaddressbook/addresseeeditordialog.cpp index b5a60f2..b925a07 100644 --- a/kaddressbook/addresseeeditordialog.cpp +++ b/kaddressbook/addresseeeditordialog.cpp @@ -22,8 +22,11 @@ */ #include <qlayout.h> #include <qapplication.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <Q3VBoxLayout> #include <kdebug.h> #include <klocale.h> #include <kglobal.h> @@ -42,9 +45,9 @@ AddresseeEditorDialog::AddresseeEditorDialog( KABCore *core, QWidget *parent, QWidget *page = plainPage(); - QVBoxLayout *layout = new QVBoxLayout( page ); + Q3VBoxLayout *layout = new Q3VBoxLayout( page ); mEditorWidget = new AddresseeEditorWidget( core, false, page ); connect( mEditorWidget, SIGNAL( modified( const KABC::Addressee::List& ) ), SLOT( widgetModified() ) ); @@ -117,7 +120,7 @@ void AddresseeEditorDialog::slotCancel() } -#ifndef KAB_EMBEDDED -#include "addresseeeditordialog.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_addresseeeditordialog.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp index 4313998..a95db03 100644 --- a/kaddressbook/addresseeeditorwidget.cpp +++ b/kaddressbook/addresseeeditorwidget.cpp @@ -21,25 +21,29 @@ without including the source code for Qt in the source distribution. */ #include <qcheckbox.h> -#include <qhbox.h> +#include <q3hbox.h> #include <qlabel.h> #include <qlayout.h> -#include <qlistbox.h> +#include <q3listbox.h> #include <qpushbutton.h> #include <qtabwidget.h> #include <qapplication.h> #ifndef KAB_EMBEDDED -#include <qtextedit.h> +#include <q3textedit.h> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3PopupMenu> +#include <Q3VBoxLayout> #include <kaccelmanager.h> #include "keywidget.h" #include "soundwidget.h" #else //KAB_EMBEDDED -#include <qmultilineedit.h> +#include <q3multilineedit.h> #endif //KAB_EMBEDDED #include "keywidget.h" @@ -129,9 +133,9 @@ void AddresseeEditorWidget::textChanged( const QString& ) } void AddresseeEditorWidget::initGUI() { - QVBoxLayout *layout = new QVBoxLayout( this ); + Q3VBoxLayout *layout = new Q3VBoxLayout( this ); mTabWidget = new QTabWidget( this ); layout->addWidget( mTabWidget ); @@ -159,9 +163,9 @@ void AddresseeEditorWidget::setupTab1() if ( QApplication::desktop()->width() == 640 || QApplication::desktop()->width() == 320 ) { horLayout = true; maxCol = 3; } - QGridLayout *layout = new QGridLayout( tab1, 7-maxCol, maxCol ); + Q3GridLayout *layout = new Q3GridLayout( tab1, 7-maxCol, maxCol ); layout->setMargin( KDialogBase::marginHintSmall() ); layout->setSpacing( KDialogBase::spacingHintSmall() ); @@ -326,9 +330,9 @@ void AddresseeEditorWidget::setupTab1() bar = new KSeparator( KSeparator::HLine, tab1 ); layout->addMultiCellWidget( bar, 10, 10, 0, 6 ); */ /////////////////////////////////////// - QHBox *categoryBox = new QHBox( tab1 ,"cato"); + Q3HBox *categoryBox = new Q3HBox( tab1 ,"cato"); categoryBox->setSpacing( KDialogBase::spacingHint() ); categoryBox->setMargin( KDialogBase::marginHintSmall() ); // Categories @@ -336,9 +340,9 @@ void AddresseeEditorWidget::setupTab1() connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) ); mCategoryEdit = new QPushButton ( categoryBox ); mCategoryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) ); - mCatPopup = new QPopupMenu ( categoryBox ); + mCatPopup = new Q3PopupMenu ( categoryBox ); mCategoryEdit->setPopup( mCatPopup ); connect(mCatPopup,SIGNAL(aboutToShow () ), this ,SLOT(showCatPopup())); connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT(selectedCatPopup( int ))); //connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ), @@ -410,9 +414,9 @@ void AddresseeEditorWidget::setupTab1_1() // This is the Address tab QWidget *tab1_1 = new QWidget( mTabWidget ); //US QGridLayout *layout = new QGridLayout( tab1_1, 11, 7 ); - QGridLayout *layout = new QGridLayout( tab1_1, 7, 2 ); + Q3GridLayout *layout = new Q3GridLayout( tab1_1, 7, 2 ); layout->setMargin( KDialogBase::marginHintSmall() ); layout->setSpacing( KDialogBase::spacingHintSmall() ); QLabel *label; @@ -611,9 +615,9 @@ void AddresseeEditorWidget::setupTab2() { // This is the Details tab QWidget *tab2 = new QWidget( mTabWidget ); - QGridLayout *layout = new QGridLayout( tab2, 8, 3 ); + Q3GridLayout *layout = new Q3GridLayout( tab2, 8, 3 ); layout->setMargin( KDialogBase::marginHintSmall() ); layout->setSpacing( KDialogBase::spacingHintSmall() ); QLabel *label; @@ -690,9 +694,9 @@ void AddresseeEditorWidget::setupTab2() int iii = 6; if ( QApplication::desktop()->width() == 640 ) { - QHBox * nbox = new QHBox ( tab2 ); + Q3HBox * nbox = new Q3HBox ( tab2 ); label = new QLabel( i18n( "Nick name:" )+" ", nbox ); mNicknameEdit = new KLineEdit( nbox ); connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( textChanged( const QString& ) ) ); @@ -734,9 +738,9 @@ void AddresseeEditorWidget::setupTab2() label->setBuddy( mChildEdit ); layout->addWidget( mChildEdit, iii, 2 ); ++iii; if ( QApplication::desktop()->width() == 640 ) { - QHBox * nbox = new QHBox ( tab2 ); + Q3HBox * nbox = new Q3HBox ( tab2 ); label = new QLabel( i18n( "Birthday:" )+" ", nbox ); mBirthdayPicker = new KDateEdit( nbox ); //mBirthdayPicker->toggleDateFormat(); mBirthdayPicker->setHandleInvalid( true ); @@ -803,9 +807,9 @@ void AddresseeEditorWidget::setupTab2_1() { // This is the Details tab QWidget *tab2_2 = new QWidget( mTabWidget ); - QGridLayout *layout = new QGridLayout( tab2_2, 1, 2 ); + Q3GridLayout *layout = new Q3GridLayout( tab2_2, 1, 2 ); layout->setMargin( KDialogBase::marginHintSmall() ); layout->setSpacing( KDialogBase::spacingHintSmall() ); QLabel *label; @@ -925,14 +929,14 @@ void AddresseeEditorWidget::setupTab2_1() label->setAlignment( Qt::AlignTop | Qt::AlignLeft ); //US layout->addWidget( label, 7, 0 ); layout->addWidget( label, 0, 0 ); #ifndef KAB_EMBEDDED - mNoteEdit = new QTextEdit( tab2_2 ); - mNoteEdit->setWordWrap( QTextEdit::WidgetWidth ); + mNoteEdit = new Q3TextEdit( tab2_2 ); + mNoteEdit->setWordWrap( Q3TextEdit::WidgetWidth ); mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); #else //KAB_EMBEDDED - mNoteEdit = new QMultiLineEdit( tab2_2 ); - mNoteEdit->setWordWrap( QMultiLineEdit::WidgetWidth ); + mNoteEdit = new Q3MultiLineEdit( tab2_2 ); + mNoteEdit->setWordWrap( Q3MultiLineEdit::WidgetWidth ); mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); #endif //KAB_EMBEDDED connect( mNoteEdit, SIGNAL( textChanged() ), SLOT( emitModified() ) ); @@ -952,9 +956,9 @@ void AddresseeEditorWidget::setupTab3() { // This is the Misc tab QWidget *tab3 = new QWidget( mTabWidget ); - QGridLayout *layout = new QGridLayout( tab3, 1, 1 ); + Q3GridLayout *layout = new Q3GridLayout( tab3, 1, 1 ); layout->setMargin( KDialogBase::marginHintSmall() ); layout->setSpacing( KDialogBase::spacingHintSmall() ); //US layout->setColStretch( 2, 1 ); @@ -1004,9 +1008,9 @@ void AddresseeEditorWidget::setupTab3_1() // This is the Misc tab QWidget *tab3 = new QWidget( mTabWidget ); //US QGridLayout *layout = new QGridLayout( tab3, 2, 3 ); - QGridLayout *layout = new QGridLayout( tab3, 1, 1 ); + Q3GridLayout *layout = new Q3GridLayout( tab3, 1, 1 ); layout->setMargin( KDialogBase::marginHint() ); layout->setSpacing( KDialogBase::spacingHint() ); //US layout->setColStretch( 2, 1 ); @@ -1429,7 +1433,7 @@ QString AddresseeEditorWidget::identifier() const { return i18n( "contact_editor" ); } -#ifndef KAB_EMBEDDED -#include "addresseeeditorwidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_addresseeeditorwidget.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/addresseeeditorwidget.h b/kaddressbook/addresseeeditorwidget.h index 816bbb5..aa1207e 100644 --- a/kaddressbook/addresseeeditorwidget.h +++ b/kaddressbook/addresseeeditorwidget.h @@ -24,9 +24,9 @@ #ifndef ADDRESSEEEDITORWIDGET_H #define ADDRESSEEEDITORWIDGET_H #include <qdatetime.h> -#include <qpopupmenu.h> +#include <q3popupmenu.h> #include <qcombobox.h> #include <kabc/addressee.h> #include <kdialogbase.h> @@ -39,11 +39,11 @@ class QCheckBox; class QSpinBox; class QTabWidget; #ifndef KAB_EMBEDDED -class QTextEdit; +class Q3TextEdit; #else //KAB_EMBEDDED -class QMultiLineEdit; +class Q3MultiLineEdit; #endif //KAB_EMBEDDED class KComboBox; class KDateEdit; @@ -154,9 +154,9 @@ class AddresseeEditorWidget : public ExtensionWidget PhoneEditWidget *mPhoneEditWidget; KLineEdit *mURLEdit; KLineEdit *mIMAddressEdit; QPushButton *mCategoryEdit; - QPopupMenu *mCatPopup; + Q3PopupMenu *mCatPopup; SecrecyWidget *mSecrecyWidget; KSqueezedTextLabel *mNameLabel; // Tab2 and Tab2_2 @@ -171,11 +171,11 @@ class AddresseeEditorWidget : public ExtensionWidget QComboBox *mGenderBox; KDateEdit *mBirthdayPicker; KDateEdit *mAnniversaryPicker; #ifndef KAB_EMBEDDED - QTextEdit *mNoteEdit; + Q3TextEdit *mNoteEdit; #else //KAB_EMBEDDED - QMultiLineEdit *mNoteEdit; + Q3MultiLineEdit *mNoteEdit; #endif //KAB_EMBEDDED QSpinBox *mTimeZoneSpin; QSpinBox *mGeoLat; diff --git a/kaddressbook/addresseeutil.cpp b/kaddressbook/addresseeutil.cpp index 366384a..a860f6d 100644 --- a/kaddressbook/addresseeutil.cpp +++ b/kaddressbook/addresseeutil.cpp @@ -45,9 +45,9 @@ QString AddresseeUtil::addresseesToClipboard( const KABC::Addressee::List &list } KABC::Addressee::List AddresseeUtil::clipboardToAddressees( const QString &data ) { - uint numVCards = data.contains( "BEGIN:VCARD", false ); + uint numVCards = data.count( "BEGIN:VCARD", Qt::CaseInsensitive ); QStringList dataList = QStringList::split( "\r\n\r\n", data ); KABC::Addressee::List addrList; for ( uint i = 0; i < numVCards && i < dataList.count(); ++i ) { diff --git a/kaddressbook/addviewdialog.cpp b/kaddressbook/addviewdialog.cpp index 6def26b..b52a83c 100644 --- a/kaddressbook/addviewdialog.cpp +++ b/kaddressbook/addviewdialog.cpp @@ -24,19 +24,21 @@ #ifndef KAB_EMBEDDED #endif //KAB_EMBEDDED #include <qradiobutton.h> -#include <qbuttongroup.h> +#include <q3buttongroup.h> #include <qlabel.h> #include <qlineedit.h> #include <qlayout.h> +//Added by qt3to4: +#include <Q3GridLayout> #include <klocale.h> #include <kglobal.h> #include "kaddressbookview.h" #include "addviewdialog.h" -AddViewDialog::AddViewDialog( QDict<ViewFactory> *viewFactoryDict, +AddViewDialog::AddViewDialog( Q3Dict<ViewFactory> *viewFactoryDict, QWidget *parent, const char *name ) : KDialogBase( KDialogBase::Plain, i18n( "Add View" ), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, parent, name ), @@ -47,9 +49,9 @@ AddViewDialog::AddViewDialog( QDict<ViewFactory> *viewFactoryDict, mTypeId = 0; QWidget *page = plainPage(); - QGridLayout *layout = new QGridLayout( page, 2, 2 ); + Q3GridLayout *layout = new Q3GridLayout( page, 2, 2 ); layout->setSpacing( spacingHint() ); layout->setRowStretch( 1, 1 ); layout->setColStretch( 1, 1 ); @@ -60,14 +62,14 @@ AddViewDialog::AddViewDialog( QDict<ViewFactory> *viewFactoryDict, connect( mViewNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( textChanged( const QString& ) ) ); layout->addWidget( mViewNameEdit, 0, 1 ); - mTypeGroup = new QButtonGroup( 2, Qt::Horizontal, i18n( "View Type" ), page ); + mTypeGroup = new Q3ButtonGroup( 2, Qt::Horizontal, i18n( "View Type" ), page ); connect( mTypeGroup, SIGNAL( clicked( int ) ), this, SLOT( clicked( int ) ) ); layout->addMultiCellWidget( mTypeGroup, 1, 1, 0, 1 ); // Now create the radio buttons. This needs some layout work. - QDictIterator<ViewFactory> iter( *mViewFactoryDict ); + Q3DictIterator<ViewFactory> iter( *mViewFactoryDict ); for ( iter.toFirst(); iter.current(); ++iter ) { //US i am not quit sure, why I can nopt use (*iter)-> here //US new QRadioButton( (*iter)->type(), mTypeGroup ); //US label = new QLabel( (*iter)->description(), mTypeGroup ); @@ -112,7 +114,7 @@ void AddViewDialog::textChanged( const QString &text ) { enableButton( KDialogBase::Ok, !text.isEmpty() ); } -#ifndef KAB_EMBEDDED -#include "addviewdialog.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_addviewdialog.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/addviewdialog.h b/kaddressbook/addviewdialog.h index 8cc12f5..c3e8efd 100644 --- a/kaddressbook/addviewdialog.h +++ b/kaddressbook/addviewdialog.h @@ -24,13 +24,13 @@ #ifndef ADDVIEWDIALOG_H #define ADDVIEWDIALOG_H #include <kdialogbase.h> -#include <qdict.h> +#include <q3dict.h> #include <qstring.h> class ViewFactory; -class QButtonGroup; +class Q3ButtonGroup; class QLineEdit; /** @@ -42,9 +42,9 @@ class AddViewDialog : public KDialogBase { Q_OBJECT public: - AddViewDialog( QDict<ViewFactory> *viewFactoryDict, QWidget *parent, + AddViewDialog( Q3Dict<ViewFactory> *viewFactoryDict, QWidget *parent, const char *name = 0 ); ~AddViewDialog(); QString viewName()const; @@ -62,11 +62,11 @@ class AddViewDialog : public KDialogBase */ void textChanged( const QString &text ); private: - QDict<ViewFactory> *mViewFactoryDict; + Q3Dict<ViewFactory> *mViewFactoryDict; QLineEdit *mViewNameEdit; - QButtonGroup *mTypeGroup; + Q3ButtonGroup *mTypeGroup; int mTypeId; }; diff --git a/kaddressbook/details/detailsviewcontainer.cpp b/kaddressbook/details/detailsviewcontainer.cpp index cee5886..4a86aca 100644 --- a/kaddressbook/details/detailsviewcontainer.cpp +++ b/kaddressbook/details/detailsviewcontainer.cpp @@ -21,12 +21,15 @@ without including the source code for Qt in the source distribution. */ #include <qcombobox.h> -#include <qframe.h> +#include <q3frame.h> #include <qlabel.h> #include <qlayout.h> -#include <qwidgetstack.h> +#include <q3widgetstack.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3VBoxLayout> #include <kapplication.h> #include <kdebug.h> #include <kdialog.h> @@ -44,28 +47,28 @@ ViewContainer::ViewContainer( QWidget *parent, const char* name ) : QWidget( parent, name ), mCurrentLook( 0 ) { - QBoxLayout *topLayout = new QVBoxLayout( this ); + Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); //topLayout->setMargin( KDialog::marginHint() ); //topLayout->setSpacing( KDialog::spacingHint() ); topLayout->setMargin( 0 ); topLayout->setSpacing( 0 ); - QBoxLayout *styleLayout = new QHBoxLayout( topLayout ); + Q3BoxLayout *styleLayout = new Q3HBoxLayout( topLayout ); QLabel *label = new QLabel( i18n("Style:"), this ); styleLayout->addWidget( label ); mStyleCombo = new QComboBox( this ); styleLayout->addWidget( mStyleCombo ); - QFrame *frameRuler = new QFrame( this ); + Q3Frame *frameRuler = new Q3Frame( this ); //US frameRuler->setFrameShape( QFrame::HLine ); //US frameRuler->setFrameShadow( QFrame::Sunken ); //US topLayout->addWidget( frameRuler ); - mDetailsStack = new QWidgetStack( this ); + mDetailsStack = new Q3WidgetStack( this ); topLayout->addWidget( mDetailsStack, 1 ); registerLooks(); @@ -158,7 +161,7 @@ void ViewContainer::setReadOnly( bool state ) if ( mCurrentLook ) mCurrentLook->setReadOnly( state ); } -#ifndef KAB_EMBEDDED -#include "detailsviewcontainer.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_detailsviewcontainer.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/details/detailsviewcontainer.h b/kaddressbook/details/detailsviewcontainer.h index 9684736..f310a30 100644 --- a/kaddressbook/details/detailsviewcontainer.h +++ b/kaddressbook/details/detailsviewcontainer.h @@ -23,14 +23,14 @@ #ifndef DETAILSVIEWCONTAINER_H #define DETAILSVIEWCONTAINER_H -#include <qptrlist.h> +#include <q3ptrlist.h> #include "look_basic.h" class QComboBox; -class QWidgetStack; +class Q3WidgetStack; class ViewContainer : public QWidget { Q_OBJECT @@ -93,11 +93,11 @@ class ViewContainer : public QWidget private: KABC::Addressee mCurrentAddressee; KABBasicLook *mCurrentLook; - QPtrList<KABLookFactory> mLookFactories; + Q3PtrList<KABLookFactory> mLookFactories; QComboBox *mStyleCombo; - QWidgetStack *mDetailsStack; + Q3WidgetStack *mDetailsStack; }; #endif diff --git a/kaddressbook/details/look_basic.cpp b/kaddressbook/details/look_basic.cpp index 0245686..48cc42a 100644 --- a/kaddressbook/details/look_basic.cpp +++ b/kaddressbook/details/look_basic.cpp @@ -25,9 +25,9 @@ #include "look_basic.h" KABBasicLook::KABBasicLook( QWidget *parent, const char *name ) - : QVBox( parent, name ), mReadOnly( false ) + : Q3VBox( parent, name ), mReadOnly( false ) { } void KABBasicLook::setReadOnly( bool state ) @@ -69,7 +69,7 @@ KABLookFactory::KABLookFactory( QWidget *parent, const char *name ) KABLookFactory::~KABLookFactory() { } -#ifndef KAB_EMBEDDED -#include "look_basic.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_look_basic.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/details/look_basic.h b/kaddressbook/details/look_basic.h index a65c99c..a70e7f7 100644 --- a/kaddressbook/details/look_basic.h +++ b/kaddressbook/details/look_basic.h @@ -24,9 +24,9 @@ #ifndef LOOK_KABBASIC_H #define LOOK_KABBASIC_H #include <kabc/addressbook.h> -#include <qvbox.h> +#include <q3vbox.h> class KConfig; /** @@ -40,9 +40,9 @@ class KConfig; The paintEvent() has to paint the whole widget, since repaint() calls will not delete the widgets background. */ -class KABBasicLook : public QVBox +class KABBasicLook : public Q3VBox { Q_OBJECT public: diff --git a/kaddressbook/details/look_details.cpp b/kaddressbook/details/look_details.cpp index 11d06e9..2c3a79d 100644 --- a/kaddressbook/details/look_details.cpp +++ b/kaddressbook/details/look_details.cpp @@ -188,12 +188,12 @@ void KABDetailedView::mouseMoveEvent( QMouseEvent *e ) } void KABDetailedView::mousePressEvent( QMouseEvent *e ) { - QPopupMenu menu( this ); - QPopupMenu *menuBG = new QPopupMenu( &menu ); - mMenuBorderedBG = new QPopupMenu( &menu ); - mMenuTiledBG = new QPopupMenu( &menu ); + Q3PopupMenu menu( this ); + Q3PopupMenu *menuBG = new Q3PopupMenu( &menu ); + mMenuBorderedBG = new Q3PopupMenu( &menu ); + mMenuTiledBG = new Q3PopupMenu( &menu ); menu.insertItem( i18n( "Select Background" ), menuBG ); menuBG->insertItem( i18n( "Bordered Backgrounds" ), mMenuBorderedBG ); menuBG->insertItem( i18n( "Tiled Backgrounds" ), mMenuTiledBG ); @@ -413,7 +413,7 @@ void KABDetailedView::restoreSettings( KConfig *config ) mPainter->setFixedFont( QFont( ffont, fpointsize, QFont::Normal, false ) ); mPainter->setCommentFont( QFont( gfont, gpointsize, QFont::Normal, false ) ); } -#ifndef KAB_EMBEDDED -#include "look_details.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_look_details.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/details/look_details.h b/kaddressbook/details/look_details.h index e8d50a9..b59d3a7 100644 --- a/kaddressbook/details/look_details.h +++ b/kaddressbook/details/look_details.h @@ -129,10 +129,10 @@ class KABDetailedView : public KABBasicLook const int mGrid; QStringList mBorders; QStringList mTiles; - QPopupMenu *mMenuBorderedBG; - QPopupMenu *mMenuTiledBG; + Q3PopupMenu *mMenuBorderedBG; + Q3PopupMenu *mMenuTiledBG; static const QString mBorderedBGDir; static const QString mTiledBGDir; }; diff --git a/kaddressbook/details/look_html.cpp b/kaddressbook/details/look_html.cpp index bb30650..4ec1c7d 100644 --- a/kaddressbook/details/look_html.cpp +++ b/kaddressbook/details/look_html.cpp @@ -23,9 +23,9 @@ #include <addresseeview.h> #include "look_html.h" -#include <qscrollview.h> +#include <q3scrollview.h> #include "kabprefs.h" #include <kabc/addresseeview.h> KABHtmlView::KABHtmlView( QWidget *parent, const char *name ) : KABBasicLook( parent, name ) @@ -50,7 +50,7 @@ void KABHtmlView::setAddressee( const KABC::Addressee &addr ) mView->setFont( KABPrefs::instance()->mDetailsFont ); mView->setAddressee( addr ); } -#ifndef KAB_EMBEDDED -#include "look_html.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_look_html.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/emaileditwidget.cpp b/kaddressbook/emaileditwidget.cpp index e72face..09df47f 100644 --- a/kaddressbook/emaileditwidget.cpp +++ b/kaddressbook/emaileditwidget.cpp @@ -27,9 +27,11 @@ #include <qpushbutton.h> #include <qstring.h> #include <qtoolbutton.h> #include <qtooltip.h> -#include <qlistbox.h> +#include <q3listbox.h> +//Added by qt3to4: +#include <Q3GridLayout> #ifndef KAB_EMBEDDED #include <kaccelmanager.h> #endif //KAB_EMBEDDED @@ -47,16 +49,16 @@ EmailEditWidget::EmailEditWidget( QWidget *parent, const char *name ) : QWidget( parent, name ) { - QGridLayout *topLayout = new QGridLayout( this, 2, 2 ); + Q3GridLayout *topLayout = new Q3GridLayout( this, 2, 2 ); topLayout->setSpacing( KDialog::spacingHint() ); QLabel* label = new QLabel( this ); label->setPixmap( KGlobal::iconLoader()->loadIcon( "mail_send", KIcon::Desktop, 0) ); topLayout->addWidget( label, 0, 0 ); - label->setAlignment( AlignCenter ); + label->setAlignment( Qt::AlignCenter ); QPushButton *editButton = new QPushButton( i18n( "Edit Email Addresses..." ), this); topLayout->addWidget( editButton, 0, 1 ); label = new QLabel( i18n( "Email:" ), this ); topLayout->addWidget( label, 1, 0 ); @@ -136,9 +138,9 @@ EmailEditDialog::EmailEditDialog( const QStringList &list, QWidget *parent, parent, name, true ) { QWidget *page = plainPage(); - QGridLayout *topLayout = new QGridLayout( page, 4, 3 ); + Q3GridLayout *topLayout = new Q3GridLayout( page, 4, 3 ); QLabel *label = new QLabel( i18n( "Email address:" ), page ); topLayout->addWidget( label, 0, 0 ); @@ -153,9 +155,9 @@ EmailEditDialog::EmailEditDialog( const QStringList &list, QWidget *parent, mAddButton->setEnabled( false ); connect( mAddButton, SIGNAL( clicked() ), SLOT( add() ) ); topLayout->addWidget( mAddButton, 0, 2 ); - mEmailListBox = new QListBox( page ); + mEmailListBox = new Q3ListBox( page ); // Make sure there is room for the scrollbar mEmailListBox->setMinimumHeight( mEmailListBox->sizeHint().height() + 30 ); connect( mEmailListBox, SIGNAL( highlighted( int ) ), @@ -271,7 +273,7 @@ void EmailEditDialog::emailChanged() { mAddButton->setEnabled( !mEmailEdit->text().isEmpty() ); } -#ifndef KAB_EMBEDDED -#include "emaileditwidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_emaileditwidget.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/emaileditwidget.h b/kaddressbook/emaileditwidget.h index acdecaf..618acee 100644 --- a/kaddressbook/emaileditwidget.h +++ b/kaddressbook/emaileditwidget.h @@ -28,13 +28,13 @@ #include <kdialogbase.h> #include "addresseeconfig.h" -class QButtonGroup; +class Q3ButtonGroup; class QCheckBox; -class QListView; -class QListBox; -class QTextEdit; +class Q3ListView; +class Q3ListBox; +class Q3TextEdit; class QToolButton; class KComboBox; class KLineEdit; @@ -88,9 +88,9 @@ class EmailEditDialog : public KDialogBase void emailChanged(); private: KLineEdit *mEmailEdit; - QListBox *mEmailListBox; + Q3ListBox *mEmailListBox; QPushButton *mAddButton; QPushButton *mRemoveButton; QPushButton *mEditButton; QPushButton *mStandardButton; diff --git a/kaddressbook/extensionmanager.cpp b/kaddressbook/extensionmanager.cpp index 46defa1..5356224 100644 --- a/kaddressbook/extensionmanager.cpp +++ b/kaddressbook/extensionmanager.cpp @@ -21,8 +21,10 @@ without including the source code for Qt in the source distribution. */ #include <qlayout.h> #include <qapplication.h> +//Added by qt3to4: +#include <Q3HBoxLayout> #include <kactionclasses.h> #include <kconfig.h> #include <kdebug.h> #include <klocale.h> @@ -41,9 +43,9 @@ #include "extensionmanager.h" ExtensionManager::ExtensionManager( KABCore *core, QWidget *parent, const char *name ) - : QScrollView( parent, name ), mCore( core ), mCurrentExtensionWidget( 0 ) + : Q3ScrollView( parent, name ), mCore( core ), mCurrentExtensionWidget( 0 ) { #ifdef KAB_EMBEDDED //US QPopupMenu *settingsmenu = (QPopupMenu*)mCore->getSettingsMenu(); QWidget *settingsmenu = (QWidget*)mCore->getViewMenu(); @@ -57,9 +59,9 @@ ExtensionManager::ExtensionManager( KABCore *core, QWidget *parent, connect( mActionExtensions, SIGNAL( activated( int ) ), SLOT( setActiveExtension( int ) ) ); mWidgetBox = new QWidget( viewport() ); - new QHBoxLayout (mWidgetBox ); + new Q3HBoxLayout (mWidgetBox ); addChild( mWidgetBox ); setResizePolicy(AutoOneFit); createExtensionWidgets(); hide(); @@ -147,9 +149,9 @@ void ExtensionManager::setActiveExtension( int id ) void ExtensionManager::createExtensionWidgets() { // clear extension widget list mExtensionWidgetList.setAutoDelete( true ); - QPtrListIterator<ExtensionWidget> wdgIt( mExtensionWidgetList ); + Q3PtrListIterator<ExtensionWidget> wdgIt( mExtensionWidgetList ); ExtensionWidget *wdg = 0; while ( ( wdg = wdgIt.current() ) != 0 ) mExtensionWidgetList.remove( wdg ); @@ -158,9 +160,9 @@ void ExtensionManager::createExtensionWidgets() QStringList extensionNames( i18n( "None" ) ); // add addressee editor as default - QHBoxLayout *hbl = (QHBoxLayout *) mWidgetBox->layout();; + Q3HBoxLayout *hbl = (Q3HBoxLayout *) mWidgetBox->layout();; wdg = new AddresseeEditorWidget( mCore, true, mWidgetBox ); hbl->addWidget( wdg ); //wdg->hide(); @@ -243,7 +245,7 @@ void ExtensionManager::createExtensionWidgets() mActionExtensions->setItems( extensionNames ); mCurrentExtensionWidget = 0; } -#ifndef KAB_EMBEDDED -#include "extensionmanager.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_extensionmanager.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/extensionmanager.h b/kaddressbook/extensionmanager.h index 611a037..84c948b 100644 --- a/kaddressbook/extensionmanager.h +++ b/kaddressbook/extensionmanager.h @@ -23,19 +23,19 @@ #ifndef EXTENSIONMANAGER_H #define EXTENSIONMANAGER_H -#include <qhbox.h> -#include <qscrollview.h> -#include <qptrlist.h> +#include <q3hbox.h> +#include <q3scrollview.h> +#include <q3ptrlist.h> #include <extensionwidget.h> class KABCore; class KSelectAction; -class ExtensionManager : public QScrollView +class ExtensionManager : public Q3ScrollView { Q_OBJECT public: @@ -79,9 +79,9 @@ class ExtensionManager : public QScrollView KABCore *mCore; QWidget *mWidgetBox; ExtensionWidget *mCurrentExtensionWidget; - QPtrList<ExtensionWidget> mExtensionWidgetList; + Q3PtrList<ExtensionWidget> mExtensionWidgetList; KSelectAction *mActionExtensions; }; diff --git a/kaddressbook/extensionwidget.cpp b/kaddressbook/extensionwidget.cpp index 69f4aa8..7c3b415 100644 --- a/kaddressbook/extensionwidget.cpp +++ b/kaddressbook/extensionwidget.cpp @@ -77,8 +77,7 @@ ConfigureWidget *ExtensionFactory::configureWidget( QWidget*, const char* ) { return 0; } -#ifndef KAB_EMBEDDED -#include "extensionwidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_extensionwidget.cpp" #endif //KAB_EMBEDDED - diff --git a/kaddressbook/extensionwidget.h b/kaddressbook/extensionwidget.h index fc91f21..9fcfba9 100644 --- a/kaddressbook/extensionwidget.h +++ b/kaddressbook/extensionwidget.h @@ -85,11 +85,11 @@ class ExtensionWidget : public QWidget ExtensionWidgetPrivate *d; }; #ifndef KAB_EMBEDDED -//MOC_SKIP_BEGIN +#ifndef Q_MOC_RUN class ExtensionFactory : public KLibFactory -//MOC_SKIP_END +#endif #else //KAB_EMBEDDED class ExtensionFactory #endif //KAB_EMBEDDED { diff --git a/kaddressbook/features/distributionlistwidget.cpp b/kaddressbook/features/distributionlistwidget.cpp index bfcb121..996177b 100644 --- a/kaddressbook/features/distributionlistwidget.cpp +++ b/kaddressbook/features/distributionlistwidget.cpp @@ -20,15 +20,22 @@ with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ -#include <qbuttongroup.h> +#include <q3buttongroup.h> #include <qcombobox.h> #include <qlabel.h> #include <qlayout.h> -#include <qlistview.h> +#include <q3listview.h> #include <qpushbutton.h> #include <qradiobutton.h> +//Added by qt3to4: +#include <QDragMoveEvent> +#include <QDropEvent> +#include <Q3GridLayout> +#include <Q3Frame> +#include <Q3VBoxLayout> +#include <QDragEnterEvent> #ifndef KAB_EMBEDDED #include <kaccelmanager.h> #endif //KAB_EMBEDDED @@ -76,14 +83,14 @@ extern "C" { } } #endif //KAB_EMBEDDED -class ContactItem : public QListViewItem +class ContactItem : public Q3ListViewItem { public: ContactItem( DistributionListView *parent, const KABC::Addressee &addressee, const QString &email = QString::null ) : - QListViewItem( parent ), + Q3ListViewItem( parent ), mAddressee( addressee ), mEmail( email ) { setText( 0, addressee.realName() ); @@ -120,9 +127,9 @@ class ContactItem : public QListViewItem DistributionListWidget::DistributionListWidget( KABCore *core, QWidget *parent, const char *name ) : ExtensionWidget( core, parent, name ), mManager( 0 ) { - QGridLayout *topLayout = new QGridLayout( this, 3, 4, KDialog::marginHint(), + Q3GridLayout *topLayout = new Q3GridLayout( this, 3, 4, KDialog::marginHint(), KDialog::spacingHint() ); if (KGlobal::getOrientation() == KGlobal::Portrait) { @@ -165,10 +172,10 @@ DistributionListWidget::DistributionListWidget( KABCore *core, QWidget *parent, topLayout->addMultiCellWidget( mContactView, 1, 1, 0, 3 ); connect( mContactView, SIGNAL( selectionChanged() ), SLOT( selectionContactViewChanged() ) ); - connect( mContactView, SIGNAL( dropped( QDropEvent*, QListViewItem* ) ), - SLOT( dropped( QDropEvent*, QListViewItem* ) ) ); + connect( mContactView, SIGNAL( dropped( QDropEvent*, Q3ListViewItem* ) ), + SLOT( dropped( QDropEvent*, Q3ListViewItem* ) ) ); mAddContactButton->setEnabled( false ); topLayout->addWidget( mAddContactButton, 2, 0 ); connect( mAddContactButton, SIGNAL( clicked() ), SLOT( addContact() ) ); @@ -409,9 +416,9 @@ QString DistributionListWidget::identifier() const { return "distribution_list_editor"; } -void DistributionListWidget::dropped( QDropEvent *e, QListViewItem* ) +void DistributionListWidget::dropped( QDropEvent *e, Q3ListViewItem* ) { dropEvent( e ); } @@ -431,17 +438,17 @@ DistributionListView::DistributionListView( QWidget *parent, const char* name ) void DistributionListView::dragEnterEvent( QDragEnterEvent* e ) { #ifndef KAB_EMBEDDED - bool canDecode = QTextDrag::canDecode( e ); + bool canDecode = Q3TextDrag::canDecode( e ); e->accept( canDecode ); #endif //KAB_EMBEDDED } void DistributionListView::viewportDragMoveEvent( QDragMoveEvent *e ) { #ifndef KAB_EMBEDDED - bool canDecode = QTextDrag::canDecode( e ); + bool canDecode = Q3TextDrag::canDecode( e ); e->accept( canDecode ); #endif //KAB_EMBEDDED } @@ -460,12 +467,12 @@ EmailSelector::EmailSelector( const QStringList &emails, const QString ¤t, QWidget *parent ) : KDialogBase( KDialogBase::Plain, i18n("Select Email Address"), Ok, Ok, parent ) { - QFrame *topFrame = plainPage(); - QBoxLayout *topLayout = new QVBoxLayout( topFrame ); + Q3Frame *topFrame = plainPage(); + Q3BoxLayout *topLayout = new Q3VBoxLayout( topFrame ); - mButtonGroup = new QButtonGroup( 1, Horizontal, i18n("Email Addresses"), + mButtonGroup = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("Email Addresses"), topFrame ); topLayout->addWidget( mButtonGroup ); QStringList::ConstIterator it; @@ -478,9 +485,9 @@ EmailSelector::EmailSelector( const QStringList &emails, } QString EmailSelector::selected() { - QButton *button = mButtonGroup->selected(); + QAbstractButton *button = mButtonGroup->selected(); if ( button ) return button->text(); return QString::null; @@ -495,7 +502,7 @@ QString EmailSelector::getEmail( const QStringList &emails, return dlg.selected(); } -#ifndef KAB_EMBEDDED -#include "distributionlistwidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_distributionlistwidget.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/features/distributionlistwidget.h b/kaddressbook/features/distributionlistwidget.h index 82bac3d..f619389 100644 --- a/kaddressbook/features/distributionlistwidget.h +++ b/kaddressbook/features/distributionlistwidget.h @@ -27,13 +27,18 @@ #include <kdialogbase.h> #include <klistview.h> #include "extensionwidget.h" +//Added by qt3to4: +#include <QDragEnterEvent> +#include <QDropEvent> +#include <QLabel> +#include <QDragMoveEvent> -class QButtonGroup; +class Q3ButtonGroup; class QComboBox; class QLabel; -class QListView; +class Q3ListView; class DistributionListView; class KABCore; @@ -56,9 +61,9 @@ class DistributionListWidget : public ExtensionWidget QString identifier() const; public slots: void save(); - void dropped( QDropEvent*, QListViewItem* ); + void dropped( QDropEvent*, Q3ListViewItem* ); private slots: void createList(); void editList(); @@ -119,9 +124,9 @@ class EmailSelector : public KDialogBase static QString getEmail( const QStringList &emails, const QString ¤t, QWidget *parent ); private: - QButtonGroup *mButtonGroup; + Q3ButtonGroup *mButtonGroup; }; #ifdef KAB_EMBEDDED diff --git a/kaddressbook/features/mergewidget.cpp b/kaddressbook/features/mergewidget.cpp index 2476e42..1becc2f 100644 --- a/kaddressbook/features/mergewidget.cpp +++ b/kaddressbook/features/mergewidget.cpp @@ -22,8 +22,10 @@ */ #include <qlayout.h> #include <qpushbutton.h> +//Added by qt3to4: +#include <Q3GridLayout> #ifndef KAB_EMBEDDED #include <kaccelmanager.h> #endif //KAB_EMBEDDED @@ -62,13 +64,13 @@ extern "C" { } } #endif //KAB_EMBEDDED -class ContactItem : public QListViewItem +class ContactItem : public Q3ListViewItem { public: ContactItem( KListView *parent, const KABC::Addressee &addressee ) - : QListViewItem( parent ), mAddressee( addressee ) + : Q3ListViewItem( parent ), mAddressee( addressee ) { KABC::Field::List fieldList = KABC::Field::defaultFields(); KABC::Field::List::ConstIterator it; @@ -93,9 +95,9 @@ MergeWidget::MergeWidget( KABCore *core, QWidget *parent, const char *name ) if (KGlobal::getOrientation() == KGlobal::Portrait) parent->setMaximumSize( KGlobal::getDesktopWidth() , 180); #endif //KAB_EMBEDDED - QGridLayout *topLayout = new QGridLayout( this, 3, 2, KDialog::marginHint(), + Q3GridLayout *topLayout = new Q3GridLayout( this, 3, 2, KDialog::marginHint(), KDialog::spacingHint() ); mContactView = new KListView( this ); KABC::Field::List fieldList = KABC::Field::defaultFields(); @@ -213,9 +215,9 @@ void MergeWidget::mergeAndRemove() retval << mMasterAddressee; emit modified( retval ); mBlockUpdate = true; - core()->deleteContacts( oldUID ); + core()->deleteContacts( QStringList(oldUID) ); core()->setContactSelected( mMasterAddressee.uid() ); mBlockUpdate = false; updateView(); @@ -368,7 +370,7 @@ void MergeWidget::doMerge( const KABC::Addressee &addr ) newCustoms.append( *it ); mMasterAddressee.setCustoms( newCustoms ); } -#ifndef KAB_EMBEDDED -#include "mergewidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_mergewidget.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/features/mergewidget.h b/kaddressbook/features/mergewidget.h index 1063c80..bb16282 100644 --- a/kaddressbook/features/mergewidget.h +++ b/kaddressbook/features/mergewidget.h @@ -28,9 +28,9 @@ #include <klistview.h> #include "extensionwidget.h" -class QListView; +class Q3ListView; class KABCore; namespace KABC { diff --git a/kaddressbook/filter.cpp b/kaddressbook/filter.cpp index 12ab1e3..6462310 100644 --- a/kaddressbook/filter.cpp +++ b/kaddressbook/filter.cpp @@ -217,9 +217,9 @@ Filter::List Filter::restore( KConfig *config, QString baseGroup ) Filter filter; filter.noName = false; filter.mName = *it; filter.mEnabled = true; - filter.mCategoryList = *it; + filter.mCategoryList = QStringList(*it); filter.mMatchRule = Matching; filter.mInternal = true; list.append( filter ); } diff --git a/kaddressbook/filter.h b/kaddressbook/filter.h index f4ae123..508436d 100644 --- a/kaddressbook/filter.h +++ b/kaddressbook/filter.h @@ -25,9 +25,9 @@ #define FILTER_H #include <qstring.h> #include <qstringlist.h> -#include <qvaluelist.h> +#include <q3valuelist.h> #include <kabc/addressee.h> #include <kconfig.h> @@ -41,9 +41,9 @@ class Filter public: enum { ShowPublic = 1, ShowPrivate = 2, ShowConfidential = 4 }; void setCriteria(int c) { mCriteria = c ;} int criteria() const { return mCriteria;} - typedef QValueList<Filter> List; + typedef Q3ValueList<Filter> List; enum MatchRule { Matching = 0, NotMatching = 1 }; Filter(); diff --git a/kaddressbook/filtereditdialog.cpp b/kaddressbook/filtereditdialog.cpp index ef9b979..40698a7 100644 --- a/kaddressbook/filtereditdialog.cpp +++ b/kaddressbook/filtereditdialog.cpp @@ -27,10 +27,10 @@ Copyright (c) 2004 Ulf Schenk $Id$ */ -#include <qbuttongroup.h> -#include <qhbox.h> +#include <q3buttongroup.h> +#include <q3hbox.h> #include <qlabel.h> #include <qlayout.h> #include <qpushbutton.h> #include <qradiobutton.h> @@ -39,8 +39,10 @@ $Id$ #include <qstring.h> #include <qtoolbutton.h> #include <qtooltip.h> #include <qwidget.h> +//Added by qt3to4: +#include <Q3GridLayout> #include <kapplication.h> #include <kbuttonbox.h> #include <kdebug.h> @@ -63,9 +65,9 @@ FilterEditDialog::FilterEditDialog( QWidget *parent, const char *name ) QStringList cats = KABPrefs::instance()->mCustomCategories; QStringList::Iterator iter; for ( iter = cats.begin(); iter != cats.end(); ++iter ) - mCategoriesView->insertItem( new QCheckListItem( mCategoriesView, (*iter), QCheckListItem::CheckBox ) ); + mCategoriesView->insertItem( new Q3CheckListItem( mCategoriesView, (*iter), Q3CheckListItem::CheckBox ) ); filterNameTextChanged( mNameEdit->text() ); } FilterEditDialog::~FilterEditDialog() @@ -76,12 +78,12 @@ void FilterEditDialog::setFilter( const Filter &filter ) { mNameEdit->setText( filter.name() ); QStringList categories = filter.categories(); - QListViewItem *item = mCategoriesView->firstChild(); + Q3ListViewItem *item = mCategoriesView->firstChild(); while ( item != 0 ) { if ( categories.contains( item->text( 0 ) ) ) { - QCheckListItem *checkItem = static_cast<QCheckListItem*>( item ); + Q3CheckListItem *checkItem = static_cast<Q3CheckListItem*>( item ); checkItem->setOn( true ); } item = item->nextSibling(); @@ -104,11 +106,11 @@ Filter FilterEditDialog::filter() filter.setName( mNameEdit->text() ); QStringList categories; - QListViewItem *item = mCategoriesView->firstChild(); + Q3ListViewItem *item = mCategoriesView->firstChild(); while ( item != 0 ) { - QCheckListItem *checkItem = static_cast<QCheckListItem*>( item ); + Q3CheckListItem *checkItem = static_cast<Q3CheckListItem*>( item ); if ( checkItem->isOn() ) categories.append( item->text( 0 ) ); item = item->nextSibling(); @@ -140,9 +142,9 @@ void FilterEditDialog::initGUI() QWidget *page = plainPage(); QLabel *label; - QGridLayout *topLayout = new QGridLayout( page, 3, 2, 0, spacingHint() ); + Q3GridLayout *topLayout = new Q3GridLayout( page, 3, 2, 0, spacingHint() ); label = new QLabel( i18n( "Name" ), page ); mNameEdit = new KLineEdit( page ); mNameEdit->setFocus(); @@ -154,18 +156,18 @@ void FilterEditDialog::initGUI() mCategoriesView = new KListView( page ); mCategoriesView->addColumn( i18n( "Categories" ) ); topLayout->addMultiCellWidget( mCategoriesView, 1, 1, 0, 1 ); - mMatchRuleGroup = new QHButtonGroup( i18n( "Category rule" ), page ); + mMatchRuleGroup = new Q3HButtonGroup( i18n( "Category rule" ), page ); mMatchRuleGroup->setExclusive( true ); QRadioButton *radio = new QRadioButton( i18n( "Include categories" ), mMatchRuleGroup ); //mMatchRuleGroup->insert( radio ); radio = new QRadioButton( i18n( "Exclude categories" ), mMatchRuleGroup ); radio->setChecked( true ); //mMatchRuleGroup->insert( radio ); topLayout->addMultiCellWidget( mMatchRuleGroup, 2, 2, 0, 1 ); - QHButtonGroup * mMatchPPCGroup = new QHButtonGroup(i18n( "Include contacts, that are:" ), page ); + Q3HButtonGroup * mMatchPPCGroup = new Q3HButtonGroup(i18n( "Include contacts, that are:" ), page ); mPublic = new QCheckBox( i18n( "public" ), mMatchPPCGroup ); mPrivate = new QCheckBox( i18n( "private" ), mMatchPPCGroup ); mConfidential = new QCheckBox( i18n( "confidential" ), mMatchPPCGroup ); mPublic->setChecked( true ); @@ -271,9 +273,9 @@ void FilterDialog::refresh() for ( iter = mFilterList.begin(); iter != mFilterList.end(); ++iter ) mFilterListBox->insertItem( (*iter).name() ); } -void FilterDialog::selectionChanged( QListBoxItem *item ) +void FilterDialog::selectionChanged( Q3ListBoxItem *item ) { bool state = ( item != 0 ); mEditButton->setEnabled( state ); @@ -289,18 +291,18 @@ void FilterDialog::initGUI() #endif //KAB_EMBEDDED QWidget *page = plainPage(); - QGridLayout *topLayout = new QGridLayout( page, 1, 2, 0, spacingHint() ); + Q3GridLayout *topLayout = new Q3GridLayout( page, 1, 2, 0, spacingHint() ); mFilterListBox = new KListBox( page ); topLayout->addWidget( mFilterListBox, 0, 0 ); - connect( mFilterListBox, SIGNAL( selectionChanged( QListBoxItem * ) ), - SLOT( selectionChanged( QListBoxItem * ) ) ); - connect( mFilterListBox, SIGNAL( doubleClicked ( QListBoxItem * ) ), + connect( mFilterListBox, SIGNAL( selectionChanged( Q3ListBoxItem * ) ), + SLOT( selectionChanged( Q3ListBoxItem * ) ) ); + connect( mFilterListBox, SIGNAL( doubleClicked ( Q3ListBoxItem * ) ), SLOT( edit() ) ); - KButtonBox *buttonBox = new KButtonBox( page, Vertical ); + KButtonBox *buttonBox = new KButtonBox( page, Qt::Vertical ); buttonBox->addButton( i18n( "&Add..." ), this, SLOT( add() ) ); mEditButton = buttonBox->addButton( i18n( "&Edit..." ), this, SLOT( edit() ) ); mEditButton->setEnabled( false ); mRemoveButton = buttonBox->addButton( i18n( "&Remove" ), this, SLOT( remove() ) ); @@ -309,7 +311,7 @@ void FilterDialog::initGUI() buttonBox->layout(); topLayout->addWidget( buttonBox, 0, 1 ); } -#ifndef KAB_EMBEDDED -#include "filtereditdialog.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_filtereditdialog.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/filtereditdialog.h b/kaddressbook/filtereditdialog.h index 5a8bad1..64d2976 100644 --- a/kaddressbook/filtereditdialog.h +++ b/kaddressbook/filtereditdialog.h @@ -30,21 +30,20 @@ $Id$ #ifndef FILTEREDITDIALOG_H #define FILTEREDITDIALOG_H -class QButtonGroup; +#include <Q3HButtonGroup> class QString; class QToolButton; class QWidget; -class QListBoxItem; +class Q3ListBoxItem; class QCheckBox; class KLineEdit; class KListBox; class KListView; #include <kdialogbase.h> -#include <qhbuttongroup.h> #include "filter.h" class FilterDialog : public KDialogBase @@ -61,9 +60,9 @@ class FilterDialog : public KDialogBase protected slots: void add(); void edit(); void remove(); - void selectionChanged( QListBoxItem* ); + void selectionChanged( Q3ListBoxItem* ); private: void initGUI(); void refresh(); @@ -97,9 +96,9 @@ class FilterEditDialog : public KDialogBase Filter mFilter; KLineEdit *mNameEdit; KListView *mCategoriesView; - QHButtonGroup *mMatchRuleGroup; + Q3HButtonGroup *mMatchRuleGroup; QCheckBox *mPrivate; QCheckBox *mPublic; QCheckBox *mConfidential; QPushButton *mEditButton; diff --git a/kaddressbook/geowidget.cpp b/kaddressbook/geowidget.cpp index 13cd084..caff3b2 100644 --- a/kaddressbook/geowidget.cpp +++ b/kaddressbook/geowidget.cpp @@ -26,12 +26,19 @@ #ifndef KAB_EMBEDDED #include <kaccelmanager.h> #else //KAB_EMBEDDED -#include <qtextstream.h> +#include <q3textstream.h> +//Added by qt3to4: +#include <QPaintEvent> +#include <Q3GridLayout> +#include <Q3Frame> +#include <QMouseEvent> #include <kglobal.h> #endif //KAB_EMBEDDED +#include <QDesktopWidget> + #include <knuminput.h> #include <kcombobox.h> #include <kdebug.h> #include <kiconloader.h> @@ -40,12 +47,12 @@ #include <qcheckbox.h> #include <qfile.h> #include <qapplication.h> -#include <qgroupbox.h> +#include <q3groupbox.h> #include <qlabel.h> #include <qlayout.h> -#include <qlistbox.h> +#include <q3listbox.h> #include <qpainter.h> #include <qpixmap.h> #include <qpushbutton.h> #include <qregexp.h> @@ -58,9 +65,9 @@ GeoWidget::GeoWidget( QWidget *parent, const char *name ) : QWidget( parent, name ) { QLabel *label = 0; - QGridLayout *topLayout = new QGridLayout( this, 4, 3 ); + Q3GridLayout *topLayout = new Q3GridLayout( this, 4, 3 ); topLayout->setMargin( KDialog::marginHint() ); topLayout->setSpacing( KDialog::spacingHint() ); label = new QLabel( this ); @@ -68,9 +75,9 @@ GeoWidget::GeoWidget( QWidget *parent, const char *name ) //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "package_network", KIcon::Desktop ) ); label->setPixmap( KGlobal::iconLoader()->loadIcon( "package_network", KIcon::Desktop, 0 ) ); label->setAlignment( Qt::AlignTop ); topLayout->addMultiCellWidget( label, 0, 3, 0, 0 ); - label->setAlignment( AlignCenter ); + label->setAlignment( Qt::AlignCenter ); mGeoIsValid = new QCheckBox( i18n( "Use geo data" ), this ); topLayout->addMultiCellWidget( mGeoIsValid, 0, 0, 1, 2 ); label = new QLabel( i18n( "Latitude:" ), this ); @@ -166,18 +173,18 @@ GeoDialog::GeoDialog( QWidget *parent, const char *name ) : KDialogBase( Plain, i18n( "Geo Data Input" ), Ok | Cancel, Ok, parent, name, true, true ), mUpdateSexagesimalInput( true ) { - QFrame *page = plainPage(); + Q3Frame *page = plainPage(); - QGridLayout *topLayout = new QGridLayout( page, 1, 1, marginHintSmall(), + Q3GridLayout *topLayout = new Q3GridLayout( page, 1, 1, marginHintSmall(), spacingHint() ); //topLayout->setRowStretch( 1, 1 ); mMapWidget = new GeoMapWidget( page ); mCityCombo = new KComboBox( page ); - QGroupBox *sexagesimalGroup = new QGroupBox( 0, Vertical, i18n( "Sexagesimal" ), page ); - QGridLayout *sexagesimalLayout = new QGridLayout( sexagesimalGroup->layout(), + Q3GroupBox *sexagesimalGroup = new Q3GroupBox( 0, Qt::Vertical, i18n( "Sexagesimal" ), page ); + Q3GridLayout *sexagesimalLayout = new Q3GridLayout( sexagesimalGroup->layout(), 2, 5, spacingHint() ); QLabel *label; if ( QApplication::desktop()->width() < 320 ) { label = new QLabel( i18n( "La." ), sexagesimalGroup ); @@ -428,10 +435,10 @@ void GeoDialog::loadCityList() #endif QFile file( fileName); - if ( file.open( IO_ReadOnly ) ) { - QTextStream s( &file ); + if ( file.open( QIODevice::ReadOnly ) ) { + Q3TextStream s( &file ); QString line, country; QRegExp coord( "[+-]\\d+[+-]\\d+" ); QRegExp name( "[^\\s]+/[^\\s]+" ); @@ -551,9 +558,9 @@ int GeoDialog::nearestCity( double x, double y ) GeoMapWidget::GeoMapWidget( QWidget *parent, const char *name ) : QWidget( parent, name ), mLatitude( 0 ), mLongitude( 0 ) { - setBackgroundMode( NoBackground ); + setBackgroundMode( Qt::NoBackground ); setFixedSize( 240, 120 ); update(); @@ -623,7 +630,7 @@ void GeoMapWidget::paintEvent( QPaintEvent* ) p.end(); bitBlt( this, 0, 0, &world ); } -#ifndef KAB_EMBEDDED -#include "geowidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_geowidget.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/geowidget.h b/kaddressbook/geowidget.h index 3d39691..5b64370 100644 --- a/kaddressbook/geowidget.h +++ b/kaddressbook/geowidget.h @@ -26,8 +26,12 @@ #include <qmap.h> #include <qwidget.h> +//Added by qt3to4: +#include <QLabel> +#include <QMouseEvent> +#include <QPaintEvent> #include <kdialogbase.h> namespace KABC { class Geo; diff --git a/kaddressbook/imagewidget.cpp b/kaddressbook/imagewidget.cpp index eec5e08..6ecf66d 100644 --- a/kaddressbook/imagewidget.cpp +++ b/kaddressbook/imagewidget.cpp @@ -36,25 +36,29 @@ #include <kurlrequester.h> #include <kurl.h> #include <qcheckbox.h> -#include <qgroupbox.h> +#include <q3groupbox.h> #include <qlabel.h> #include <qlayout.h> #include <qpixmap.h> #include <qpushbutton.h> #include <qapplication.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3Frame> #include "imagewidget.h" ImageWidget::ImageWidget( QWidget *parent, const char *name ) : QWidget( parent, name ) { - QGridLayout *topLayout = new QGridLayout( this, 2, 1, KDialog::marginHint(), + Q3GridLayout *topLayout = new Q3GridLayout( this, 2, 1, KDialog::marginHint(), KDialog::spacingHint() ); - QGroupBox *photoBox = new QGroupBox( 0, Qt::Vertical, i18n( "Photo" ), this ); - QGridLayout *boxLayout = new QGridLayout( photoBox->layout(), 3, 2, + Q3GroupBox *photoBox = new Q3GroupBox( 0, Qt::Vertical, i18n( "Photo" ), this ); + Q3GridLayout *boxLayout = new Q3GridLayout( photoBox->layout(), 3, 2, KDialog::spacingHint() ); boxLayout->setRowStretch( 2, 1 ); mPhotoLabel = new QLabel( photoBox ); @@ -62,9 +66,9 @@ ImageWidget::ImageWidget( QWidget *parent, const char *name ) if ( QApplication::desktop()->width() > 320 ) fac = 6; mPhotoLabel->setFixedSize( 50*9/fac, 70*9/fac ); mPhotoLabel->setScaledContents( true ); - mPhotoLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + mPhotoLabel->setFrameStyle( Q3Frame::Panel | Q3Frame::Sunken ); boxLayout->addMultiCellWidget( mPhotoLabel, 0, 3, 0, 0 ); mPhotoUrl = new KURLRequester( photoBox ); #ifndef KAB_EMBEDDED @@ -74,9 +78,9 @@ ImageWidget::ImageWidget( QWidget *parent, const char *name ) #endif //KAB_EMBEDDED boxLayout->addWidget( mPhotoUrl, 0, 1 ); - QHBox *hb1 = new QHBox ( photoBox ); + Q3HBox *hb1 = new Q3HBox ( photoBox ); mUsePhotoUrl = new QCheckBox( i18n( "Store as URL" ), hb1 ); mUsePhotoUrl->setEnabled( false ); boxLayout->addWidget( hb1, 1, 1 ); @@ -85,16 +89,16 @@ ImageWidget::ImageWidget( QWidget *parent, const char *name ) boxLayout->addWidget( new QLabel( photoBox ), 2, 1 ); topLayout->addWidget( photoBox, 0, 0 ); - QGroupBox *logoBox = new QGroupBox( 0, Qt::Vertical, i18n( "Logo" ), this ); - boxLayout = new QGridLayout( logoBox->layout(), 3, 2, KDialog::spacingHint() ); + Q3GroupBox *logoBox = new Q3GroupBox( 0, Qt::Vertical, i18n( "Logo" ), this ); + boxLayout = new Q3GridLayout( logoBox->layout(), 3, 2, KDialog::spacingHint() ); boxLayout->setRowStretch( 2, 1 ); mLogoLabel = new QLabel( logoBox ); mLogoLabel->setFixedSize( 50*9/fac, 70*9/fac ); mLogoLabel->setScaledContents( true ); - mLogoLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + mLogoLabel->setFrameStyle( Q3Frame::Panel | Q3Frame::Sunken ); boxLayout->addMultiCellWidget( mLogoLabel, 0, 3, 0, 0 ); mLogoUrl = new KURLRequester( logoBox ); #ifndef KAB_EMBEDDED @@ -103,9 +107,9 @@ ImageWidget::ImageWidget( QWidget *parent, const char *name ) //US qDebug("ImageWidget::ImageWidget KImageIO not defined 2"); #endif //KAB_EMBEDDED boxLayout->addWidget( mLogoUrl, 0, 1 ); - QHBox *hb2 = new QHBox ( logoBox ); + Q3HBox *hb2 = new Q3HBox ( logoBox ); mUseLogoUrl = new QCheckBox( i18n( "Store as URL" ), hb2 ); mUseLogoUrl->setEnabled( false ); boxLayout->addWidget( hb2, 1, 1 ); @@ -179,9 +183,9 @@ KABC::Picture ImageWidget::photo() const if ( mUsePhotoUrl->isChecked() ) photo.setUrl( mPhotoUrl->url() ); else { - QPixmap *px = mPhotoLabel->pixmap(); + const QPixmap *px = mPhotoLabel->pixmap(); if ( px ) { #ifndef KAB_EMBEDDED if ( px->height() > px->width() ) photo.setData( px->convertToImage().scaleHeight( 140 ) ); @@ -231,9 +235,9 @@ KABC::Picture ImageWidget::logo() const if ( mUseLogoUrl->isChecked() ) logo.setUrl( mLogoUrl->url() ); else { - QPixmap *px = mLogoLabel->pixmap(); + const QPixmap *px = mLogoLabel->pixmap(); if ( px ) { #ifndef KAB_EMBEDDED if ( px->height() > px->width() ) logo.setData( px->convertToImage().scaleHeight( 140 ) ); @@ -291,7 +295,7 @@ QPixmap ImageWidget::loadPixmap( const QString &url ) pixmap.load( url ); return pixmap; } -#ifndef KAB_EMBEDDED -#include "imagewidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_imagewidget.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/imagewidget.h b/kaddressbook/imagewidget.h index bbfba58..9320a6b 100644 --- a/kaddressbook/imagewidget.h +++ b/kaddressbook/imagewidget.h @@ -24,8 +24,11 @@ #ifndef IMAGEWIDGET_H #define IMAGEWIDGET_H #include <qwidget.h> +//Added by qt3to4: +#include <QPixmap> +#include <QLabel> #include <kabc/picture.h> #include <kdialogbase.h> diff --git a/kaddressbook/incsearchwidget.cpp b/kaddressbook/incsearchwidget.cpp index 5f8b83d..a54d1cd 100644 --- a/kaddressbook/incsearchwidget.cpp +++ b/kaddressbook/incsearchwidget.cpp @@ -24,9 +24,12 @@ #include <qlabel.h> #include <qlayout.h> #include <qtooltip.h> #include <qapplication.h> +#include <QDesktopWidget> #include <qcombobox.h> +//Added by qt3to4: +#include <Q3HBoxLayout> #include <kdialog.h> #include <klineedit.h> #include <klocale.h> @@ -36,19 +39,20 @@ #include "incsearchwidget.h" IncSearchWidget::IncSearchWidget( QWidget *parent, const char *name ) - : QWidget( parent, name ) { + setObjectName(name); + setParent(parent); #ifndef KAB_EMBEDDED //US setCaption( i18n( "Incremental Search" ) ); #endif //KAB_EMBEDDED - QHBoxLayout *layout = new QHBoxLayout( this, 2, KDialog::spacingHint() ); + Q3HBoxLayout *layout = new Q3HBoxLayout( this, 2, KDialog::spacingHint() ); #ifdef DESKTOP_VERSION QLabel *label = new QLabel( i18n( "Search:" ), this ); - label->setAlignment( QLabel::AlignVCenter | QLabel::AlignRight ); + label->setAlignment( Qt::AlignVCenter | Qt::AlignRight ); layout->addWidget( label ); #endif //KAB_EMBEDDED mSearchText = new KLineEdit( this ); @@ -175,7 +179,7 @@ int IncSearchWidget::currentItem() const { return mFieldCombo->currentItem(); } -#ifndef KAB_EMBEDDED -#include "incsearchwidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_incsearchwidget.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/jumpbuttonbar.cpp b/kaddressbook/jumpbuttonbar.cpp index aebf8a6..740b7db 100644 --- a/kaddressbook/jumpbuttonbar.cpp +++ b/kaddressbook/jumpbuttonbar.cpp @@ -24,10 +24,13 @@ #include <qevent.h> #include <qlayout.h> #include <qpushbutton.h> #include <qstring.h> -#include <qtl.h> +#include <q3tl.h> #include <qapplication.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <Q3GridLayout> #include <kabc/addressbook.h> #include <kabc/field.h> #include <kdebug.h> @@ -72,11 +75,11 @@ JumpButtonBar::JumpButtonBar( KABCore *core, QWidget *parent, const char *name ) : QWidget( parent, name ), mCore( core ) { if ( QApplication::desktop()->width() < 480 ) - mButtonLayout = new QGridLayout( this, 1, 18 ); + mButtonLayout = new Q3GridLayout( this, 1, 18 ); else - mButtonLayout = new QGridLayout( this, 1, 20 ); + mButtonLayout = new Q3GridLayout( this, 1, 20 ); mButtonLayout->setAlignment( Qt::AlignTop ); recreateButtons(); } @@ -251,7 +254,7 @@ void JumpButtonBar::sortListLocaleAware( QStringList &list ) --walkBackIt; } } -#ifndef KAB_EMBEDDED -#include "jumpbuttonbar.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_jumpbuttonbar.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/jumpbuttonbar.h b/kaddressbook/jumpbuttonbar.h index d534f2b..0589812 100644 --- a/kaddressbook/jumpbuttonbar.h +++ b/kaddressbook/jumpbuttonbar.h @@ -25,13 +25,16 @@ #define JUMPBUTTONBAR_H #include <qsizepolicy.h> #include <qwidget.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qstringlist.h> +//Added by qt3to4: +#include <QResizeEvent> +#include <Q3GridLayout> class QChar; -class QGridLayout; +class Q3GridLayout; class QResizeEvent; class QPushButton; class JumpButton; @@ -75,10 +78,10 @@ class JumpButtonBar : public QWidget void sortListLocaleAware( QStringList &list ); KABCore *mCore; - QGridLayout *mButtonLayout; + Q3GridLayout *mButtonLayout; QStringList mCharacters; - QPtrList<JumpButton> mButtons; + Q3PtrList<JumpButton> mButtons; }; #endif diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index ab2824c..03b44d1 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -38,20 +38,30 @@ $Id$ #include <qregexp.h> #include <qlineedit.h> #include <qcheckbox.h> #include <qpushbutton.h> -#include <qprogressbar.h> +#include <q3progressbar.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <QResizeEvent> +#include <QPixmap> +#include <Q3ValueList> +#include <Q3HBoxLayout> +#include <Q3VBoxLayout> +#include <Q3CString> +#include <Q3PopupMenu> +#include <Q3PtrList> #include <libkdepim/phoneaccess.h> #ifndef KAB_EMBEDDED #include <qclipboard.h> #include <qdir.h> #include <qfile.h> #include <qapplicaton.h> -#include <qprogressbar.h> +#include <q3progressbar.h> #include <qlayout.h> #include <qregexp.h> -#include <qvbox.h> +#include <q3vbox.h> #include <kabc/addresseelist.h> #include <kabc/errorhandler.h> #include <kabc/resource.h> #include <kabc/vcardconverter.h> @@ -87,9 +97,9 @@ $Id$ #include "addresseedialog.h" //US #include <addresseeview.h> -#include <qapp.h> +#include <qapplication.h> #include <qmenubar.h> //#include <qtoolbar.h> #include <qmessagebox.h> #include <kdebug.h> @@ -128,14 +138,14 @@ $Id$ //US#include <qsplitter.h> #include <qmap.h> #include <qdir.h> #include <qfile.h> -#include <qvbox.h> +#include <q3vbox.h> #include <qlayout.h> #include <qclipboard.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qradiobutton.h> -#include <qbuttongroup.h> +#include <q3buttongroup.h> #include <libkdepim/categoryselectdialog.h> #include <libkdepim/categoryeditdialog.h> #include <kabc/vcardconverter.h> @@ -174,14 +184,14 @@ class KABCatPrefs : public QDialog KABCatPrefs( QWidget *parent=0, const char *name=0 ) : QDialog( parent, name, true ) { setCaption( i18n("Manage new Categories") ); - QVBoxLayout* lay = new QVBoxLayout( this ); + Q3VBoxLayout* lay = new Q3VBoxLayout( this ); lay->setSpacing( 3 ); lay->setMargin( 3 ); QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\naddressees\nwhich are not in the category list.\nPlease choose what to do:\n "), this ); lay->addWidget( lab ); - QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); + Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("New categories not in list:"), this ); lay->addWidget( format ); format->setExclusive ( true ) ; addCatBut = new QRadioButton(i18n("Add to category list"), format ); new QRadioButton(i18n("Remove from addressees"), format ); @@ -206,14 +216,14 @@ class KABFormatPrefs : public QDialog KABFormatPrefs( QWidget *parent=0, const char *name=0 ) : QDialog( parent, name, true ) { setCaption( i18n("Set formatted name") ); - QVBoxLayout* lay = new QVBoxLayout( this ); + Q3VBoxLayout* lay = new Q3VBoxLayout( this ); lay->setSpacing( 3 ); lay->setMargin( 3 ); QLabel * lab = new QLabel( i18n("You can set the formatted name\nfor a list of contacts in one go."), this ); lay->addWidget( lab ); - QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Set formatted name to:"), this ); + Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("Set formatted name to:"), this ); lay->addWidget( format ); format->setExclusive ( true ) ; simple = new QRadioButton(i18n("Simple: James Bond"), format ); full = new QRadioButton(i18n("Full: Mr. James 007 Bond I"), format ); @@ -244,31 +254,31 @@ class KAex2phonePrefs : public QDialog KAex2phonePrefs( QWidget *parent=0, const char *name=0 ) : QDialog( parent, name, true ) { setCaption( i18n("Export to phone options") ); - QVBoxLayout* lay = new QVBoxLayout( this ); + Q3VBoxLayout* lay = new Q3VBoxLayout( this ); lay->setSpacing( 3 ); lay->setMargin( 3 ); QLabel *lab; lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); - lab->setAlignment (AlignHCenter ); - QHBox* temphb; - temphb = new QHBox( this ); + lab->setAlignment (Qt::AlignHCenter ); + Q3HBox* temphb; + temphb = new Q3HBox( this ); new QLabel( i18n("I/O device: "), temphb ); mPhoneDevice = new QLineEdit( temphb); lay->addWidget( temphb ); - temphb = new QHBox( this ); + temphb = new Q3HBox( this ); new QLabel( i18n("Connection: "), temphb ); mPhoneConnection = new QLineEdit( temphb); lay->addWidget( temphb ); - temphb = new QHBox( this ); + temphb = new Q3HBox( this ); new QLabel( i18n("Model(opt.): "), temphb ); mPhoneModel = new QLineEdit( temphb); lay->addWidget( temphb ); // mWriteToSim = new QCheckBox( i18n("Write Contacts to SIM card\n(if not, write to phone memory)"), this ); // lay->addWidget( mWriteToSim ); lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ncontact data on phone!"), this ) ); - lab->setAlignment (AlignHCenter); + lab->setAlignment (Qt::AlignHCenter); QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); lay->addWidget( ok ); QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); lay->addWidget( cancel ); @@ -406,9 +416,9 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const // we have a toolbar repainting error on the Zaurus when starting KA/Pi //QTimer::singleShot( 10, this , SLOT ( updateToolBar())); QTimer::singleShot( 100, this, SLOT ( loadDataAfterStart() )); } -void KABCore::receiveStart( const QCString& cmsg, const QByteArray& data ) +void KABCore::receiveStart( const Q3CString& cmsg, const QByteArray& data ) { //qDebug("KO: QCOP start message received: %s ", cmsg.data() ); mCStringMess = cmsg; mByteData = data; @@ -420,11 +430,11 @@ void KABCore::loadDataAfterStart() ((StdAddressBook*)mAddressBook)->init( true ); mViewManager->refreshView(); #ifndef DESKTOP_VERSION - disconnect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT (receiveStart ( const QCString &, const QByteArray & ))); + disconnect(qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), this, SLOT (receiveStart ( const Q3CString &, const QByteArray & ))); - QObject::connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); + QObject::connect(qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const Q3CString &, const QByteArray & ))); if ( !mCStringMess.isEmpty() ) ExternalAppHandler::instance()->appMessage( mCStringMess, mByteData ); #endif // QTimer::singleShot( 10, this , SLOT ( updateToolBar())); @@ -452,13 +462,13 @@ KABCore::~KABCore() if ( infrared ) delete infrared; #endif } -void KABCore::receive( const QCString& cmsg, const QByteArray& data ) +void KABCore::receive( const Q3CString& cmsg, const QByteArray& data ) { //qDebug("KA: QCOP message received: %s ", cmsg.data() ); if ( cmsg == "setDocument(QString)" ) { - QDataStream stream( data, IO_ReadOnly ); + QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly ); QString fileName; stream >> fileName; recieve( fileName ); return; @@ -479,9 +489,9 @@ void KABCore::toggleBeamReceive( ) qDebug("KA: AB enable BeamReceive "); mActionBR->setChecked(true); infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; - QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& ))); + QObject::connect( infrared, SIGNAL (received ( const Q3CString &, const QByteArray & )),this, SLOT(receive( const Q3CString&, const QByteArray& ))); #endif } @@ -559,9 +569,9 @@ void KABCore::restoreSettings() int wid = QApplication::desktop()->width(); if ( wid < 640 ) wid = QApplication::desktop()->height(); #endif - QValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter; + Q3ValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter; if ( true /*splitterSize.count() == 0*/ ) { splitterSize.append( wid / 2 ); splitterSize.append( wid / 2 ); } @@ -649,12 +659,12 @@ QStringList KABCore::selectedUIDs() const } KABC::Resource *KABCore::requestResource( QWidget *parent ) { - QPtrList<KABC::Resource> kabcResources = addressBook()->resources(); + Q3PtrList<KABC::Resource> kabcResources = addressBook()->resources(); - QPtrList<KRES::Resource> kresResources; - QPtrListIterator<KABC::Resource> resIt( kabcResources ); + Q3PtrList<KRES::Resource> kresResources; + Q3PtrListIterator<KABC::Resource> resIt( kabcResources ); KABC::Resource *resource; while ( ( resource = resIt.current() ) != 0 ) { ++resIt; if ( !resource->readOnly() ) { @@ -794,16 +804,16 @@ void KABCore::mailVCard( const QStringList& uids ) QString fileName = dirName + "/" + name; QFile outFile(fileName); - if ( outFile.open(IO_WriteOnly) ) { // file opened successfully + if ( outFile.open(QIODevice::WriteOnly) ) { // file opened successfully KABC::VCardConverter converter; QString vcard; converter.addresseeToVCard( a, vcard ); - QTextStream t( &outFile ); // use a text stream - t.setEncoding( QTextStream::UnicodeUTF8 ); + Q3TextStream t( &outFile ); // use a text stream + t.setEncoding( Q3TextStream::UnicodeUTF8 ); t << vcard; outFile.close(); @@ -1015,13 +1025,13 @@ void KABCore::beamVCard(const QStringList& uids) datastream += vcard.mid( start,vcard.length() ); } #ifndef DESKTOP_VERSION QFile outFile(fileName); - if ( outFile.open(IO_WriteOnly) ) { + if ( outFile.open(QIODevice::WriteOnly) ) { datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); - QTextStream t( &outFile ); // use a text stream + Q3TextStream t( &outFile ); // use a text stream //t.setEncoding( QTextStream::UnicodeUTF8 ); - t.setEncoding( QTextStream::Latin1 ); + t.setEncoding( Q3TextStream::Latin1 ); t <<datastream.latin1(); outFile.close(); Ir *ir = new Ir( this ); connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) ); @@ -1296,12 +1306,12 @@ void KABCore::addrModified( const KABC::Addressee &addr ,bool updateDetails ) void KABCore::newContact() { - QPtrList<KABC::Resource> kabcResources = mAddressBook->resources(); + Q3PtrList<KABC::Resource> kabcResources = mAddressBook->resources(); - QPtrList<KRES::Resource> kresResources; - QPtrListIterator<KABC::Resource> it( kabcResources ); + Q3PtrList<KRES::Resource> kresResources; + Q3PtrListIterator<KABC::Resource> it( kabcResources ); KABC::Resource *resource; while ( ( resource = it.current() ) != 0 ) { ++it; if ( !resource->readOnly() ) { @@ -1855,17 +1865,17 @@ void KABCore::slotEditorDestroyed( const QString &uid ) void KABCore::initGUI() { #ifndef KAB_EMBEDDED - QHBoxLayout *topLayout = new QHBoxLayout( this ); + Q3HBoxLayout *topLayout = new Q3HBoxLayout( this ); topLayout->setSpacing( KDialogBase::spacingHint() ); mExtensionBarSplitter = new QSplitter( this ); mExtensionBarSplitter->setOrientation( Qt::Vertical ); mDetailsSplitter = new QSplitter( mExtensionBarSplitter ); - QVBox *viewSpace = new QVBox( mDetailsSplitter ); + Q3VBox *viewSpace = new Q3VBox( mDetailsSplitter ); mIncSearchWidget = new IncSearchWidget( viewSpace ); connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), SLOT( incrementalSearch( const QString& ) ) ); @@ -1887,30 +1897,30 @@ void KABCore::initGUI() #else //KAB_EMBEDDED //US initialize viewMenu before settingup viewmanager. // Viewmanager needs this menu to plugin submenues. - viewMenu = new QPopupMenu( this ); - settingsMenu = new QPopupMenu( this ); + viewMenu = new Q3PopupMenu( this ); + settingsMenu = new Q3PopupMenu( this ); //filterMenu = new QPopupMenu( this ); - ImportMenu = new QPopupMenu( this ); - ExportMenu = new QPopupMenu( this ); - syncMenu = new QPopupMenu( this ); - changeMenu= new QPopupMenu( this ); - beamMenu= new QPopupMenu( this ); + ImportMenu = new Q3PopupMenu( this ); + ExportMenu = new Q3PopupMenu( this ); + syncMenu = new Q3PopupMenu( this ); + changeMenu= new Q3PopupMenu( this ); + beamMenu= new Q3PopupMenu( this ); //US since we have no splitter for the embedded system, setup // a layout with two frames. One left and one right. - QBoxLayout *topLayout; + Q3BoxLayout *topLayout; // = new QHBoxLayout( this ); // QBoxLayout *topLayout = (QBoxLayout*)layout(); // QWidget *mainBox = new QWidget( this ); // QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox); #ifdef DESKTOP_VERSION - topLayout = new QHBoxLayout( this ); + topLayout = new Q3HBoxLayout( this ); mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); @@ -1923,14 +1933,14 @@ void KABCore::initGUI() mDetails = new ViewContainer( mMiniSplitter ); mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); #else if ( QApplication::desktop()->width() > 480 ) { - topLayout = new QHBoxLayout( this ); + topLayout = new Q3HBoxLayout( this ); mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); } else { - topLayout = new QHBoxLayout( this ); + topLayout = new Q3HBoxLayout( this ); mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this); mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); } @@ -2033,19 +2043,19 @@ void KABCore::initActions() // file menu mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() ); //mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() ); - mActionPrint = new KAction( i18n( "&Print View" ), "fileprint", CTRL + Key_P, mViewManager, + mActionPrint = new KAction( i18n( "&Print View" ), "fileprint", Qt::CTRL + Qt::Key_P, mViewManager, SLOT( printView() ), actionCollection(), "kaddressbook_print" ); mActionPrintDetails = new KAction( i18n( "&Print Details" ), "fileprint", 0, mDetails, SLOT( printView() ), actionCollection(), "kaddressbook_print2" ); - mActionSave = new KAction( i18n( "&Save" ), "filesave", CTRL+Key_S, this, + mActionSave = new KAction( i18n( "&Save" ), "filesave", Qt::CTRL+Qt::Key_S, this, SLOT( save() ), actionCollection(), "file_sync" ); - mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", CTRL+Key_N, this, + mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", Qt::CTRL+Qt::Key_N, this, SLOT( newContact() ), actionCollection(), "file_new_contact" ); mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0, this, SLOT( mailVCard() ), @@ -2082,24 +2092,24 @@ void KABCore::initActions() #endif //KAB_EMBEDDED // edit menu if ( mIsPart ) { - mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this, + mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", Qt::CTRL + Qt::Key_C, this, SLOT( copyContacts() ), actionCollection(), "kaddressbook_copy" ); - mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this, + mActionCut = new KAction( i18n( "Cu&t" ), "editcut", Qt::CTRL + Qt::Key_X, this, SLOT( cutContacts() ), actionCollection(), "kaddressbook_cut" ); - mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this, + mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", Qt::CTRL + Qt::Key_V, this, SLOT( pasteContacts() ), actionCollection(), "kaddressbook_paste" ); - mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this, + mActionSelectAll = new KAction( i18n( "Select &All" ), Qt::CTRL + Qt::Key_A, this, SLOT( selectAllContacts() ), actionCollection(), "kaddressbook_select_all" ); - mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this, + mActionUndo = new KAction( i18n( "&Undo" ), "undo", Qt::CTRL + Qt::Key_Z, this, SLOT( undo() ), actionCollection(), "kaddressbook_undo" ); - mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z, + mActionRedo = new KAction( i18n( "Re&do" ), "redo", Qt::CTRL + Qt::SHIFT + Qt::Key_Z, this, SLOT( redo() ), actionCollection(), "kaddressbook_redo" ); } else { mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() ); @@ -2110,9 +2120,9 @@ void KABCore::initActions() mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() ); } mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete", - Key_Delete, this, SLOT( deleteContacts() ), + Qt::Key_Delete, this, SLOT( deleteContacts() ), actionCollection(), "edit_delete" ); mActionUndo->setEnabled( false ); mActionRedo->setEnabled( false ); @@ -2245,11 +2255,11 @@ void KABCore::addActionsManually() { //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); #ifdef KAB_EMBEDDED - QPopupMenu *fileMenu = new QPopupMenu( this ); - QPopupMenu *editMenu = new QPopupMenu( this ); - QPopupMenu *helpMenu = new QPopupMenu( this ); + Q3PopupMenu *fileMenu = new Q3PopupMenu( this ); + Q3PopupMenu *editMenu = new Q3PopupMenu( this ); + Q3PopupMenu *helpMenu = new Q3PopupMenu( this ); KToolBar* tb = mMainWindow->toolBar(); mMainWindow->setToolBarsMovable (false ); #ifndef DESKTOP_VERSION @@ -2275,9 +2285,9 @@ void KABCore::addActionsManually() #ifndef DESKTOP_VERSION } else { //US setup toolbar QPEMenuBar *menuBarTB = new QPEMenuBar( tb ); - QPopupMenu *popupBarTB = new QPopupMenu( this ); + Q3PopupMenu *popupBarTB = new Q3PopupMenu( this ); menuBarTB->insertItem( SmallIcon( "z_menu" ) , popupBarTB); tb->insertWidget(-1, 0, menuBarTB); mIncSearchWidget = new IncSearchWidget( tb ); tb->enableMoving(false); @@ -2630,9 +2640,9 @@ void KABCore::configureKeyBindings() #ifdef KAB_EMBEDDED void KABCore::configureResources() { - KRES::KCMKResources dlg( this, "" , 0 ); + KRES::KCMKResources dlg( this, "" , QStringList() ); if ( !dlg.exec() ) return; KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); @@ -2726,9 +2736,9 @@ void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString int count = 0; for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { ++count; } - QProgressBar bar(count,0 ); + Q3ProgressBar bar(count,0 ); int w = 300; if ( QApplication::desktop()->width() < 320 ) w = 220; int h = bar.sizeHint().height() ; @@ -2907,9 +2917,9 @@ KABC::Addressee KABCore::getLastSyncAddressee() if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) sum = "E: "; lse.setFamilyName("!"+sum+mCurrentSyncDevice + i18n(" - sync event")); lse.setRevision( mLastAddressbookSync ); - lse.setCategories( i18n("SyncEvent") ); + lse.setCategories( QStringList(i18n("SyncEvent")) ); mAddressBook->insertAddressee( lse ); } return lse; } @@ -3098,9 +3108,9 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo addresseeRSync = newAdd; addresseeRSync.setFamilyName(mCurrentSyncName + i18n(" - sync addressee")); addresseeRSync.setUid("last-syncAddressee-"+mCurrentSyncName ); addresseeRSync.setRevision( mLastAddressbookSync ); - addresseeRSync.setCategories( i18n("SyncAddressee") ); + addresseeRSync.setCategories( QStringList(i18n("SyncAddressee")) ); } } if ( addresseeLSync.revision() == mLastAddressbookSync ) { // qDebug("FULLDATE 2"); diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index ec6a9ec..4351720 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h @@ -27,13 +27,17 @@ #include <kabc/field.h> #ifndef KAB_EMBEDDED #endif //KAB_EMBEDDED -#include <qdict.h> +#include <q3dict.h> #include <qtimer.h> #include <qwidget.h> -#include <qpopupmenu.h> +#include <q3popupmenu.h> +//Added by qt3to4: +#include <Q3CString> +#include <QPixmap> +#include <QResizeEvent> #include <ksyncmanager.h> #ifndef DESKTOP_VERSION #include <qcopchannel_qws.h> #endif @@ -84,11 +88,11 @@ class KABCore : public QWidget, public KSyncInterface #ifdef KAB_EMBEDDED //US added functionality - QPopupMenu* getViewMenu() {return viewMenu;} - QPopupMenu* getFilterMenu() {return filterMenu;} - QPopupMenu* getSettingsMenu() {return settingsMenu;} + Q3PopupMenu* getViewMenu() {return viewMenu;} + Q3PopupMenu* getFilterMenu() {return filterMenu;} + Q3PopupMenu* getSettingsMenu() {return settingsMenu;} void addActionsManually(); #endif //KAB_EMBEDDED /** Restores the global settings. @@ -134,10 +138,10 @@ class KABCore : public QWidget, public KSyncInterface static KAboutData *createAboutData(); #endif //KAB_EMBEDDED #ifdef KAB_EMBEDDED - inline QPopupMenu* getImportMenu() { return ImportMenu;} - inline QPopupMenu* getExportMenu() { return ExportMenu;} + inline Q3PopupMenu* getImportMenu() { return ImportMenu;} + inline Q3PopupMenu* getExportMenu() { return ExportMenu;} #endif //KAB_EMBEDDED public slots: #ifdef KAB_EMBEDDED @@ -365,10 +369,10 @@ class KABCore : public QWidget, public KSyncInterface private slots: void updateToolBar(); void updateMainWindow(); - void receive( const QCString& cmsg, const QByteArray& data ); - void receiveStart( const QCString& cmsg, const QByteArray& data ); + void receive( const Q3CString& cmsg, const QByteArray& data ); + void receiveStart( const Q3CString& cmsg, const QByteArray& data ); void toggleBeamReceive( ); void disableBR(bool); void setJumpButtonBarVisible( bool visible ); void setJumpButtonBar( bool visible ); @@ -393,9 +397,9 @@ class KABCore : public QWidget, public KSyncInterface void configurationChanged(); void addressBookChanged(); private: - QCString mCStringMess; + Q3CString mCStringMess; QByteArray mByteData; QString mEmailSourceChannel; QString mEmailSourceUID; void resizeEvent(QResizeEvent* e ); @@ -485,16 +489,16 @@ class KABCore : public QWidget, public KSyncInterface KAction *mActionMultiSyncHowto; KAction *mActionDeleteView; - QPopupMenu *viewMenu; - QPopupMenu *filterMenu; - QPopupMenu *settingsMenu; - QPopupMenu *changeMenu; - QPopupMenu *beamMenu; + Q3PopupMenu *viewMenu; + Q3PopupMenu *filterMenu; + Q3PopupMenu *settingsMenu; + Q3PopupMenu *changeMenu; + Q3PopupMenu *beamMenu; //US QAction *mActionSave; - QPopupMenu *ImportMenu; - QPopupMenu *ExportMenu; + Q3PopupMenu *ImportMenu; + Q3PopupMenu *ExportMenu; //LR additional methods KAction *mActionRemoveVoice; KAction *mActionSetFormattedName; KAction * mActionImportOL; @@ -523,9 +527,9 @@ class KABCore : public QWidget, public KSyncInterface // LR ******************************* // sync stuff! QString sentSyncFile(); - QPopupMenu *syncMenu; + Q3PopupMenu *syncMenu; KSyncManager* syncManager; int mGlobalSyncMode; bool synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode); KABC::Addressee getLastSyncAddressee(); diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp index 42d541b..6f9c995 100644 --- a/kaddressbook/kabprefs.cpp +++ b/kaddressbook/kabprefs.cpp @@ -24,9 +24,9 @@ //US#ifdef KAB_EMBEDDED //#include <qstring.h> //#endif //KAB_EMBEDDED -#include <qtextstream.h> +#include <q3textstream.h> #include <qfile.h> #include <qregexp.h> #include <stdlib.h> #include <libkdepim/kpimglobalprefs.h> @@ -90,9 +90,9 @@ KABPrefs::KABPrefs() KPrefs::setCurrentGroup( "Views" ); QString defaultView = i18n( "Default Table View" ); addItemString( "CurrentView", &mCurrentView, defaultView ); - addItemStringList( "ViewNames", &mViewNames, defaultView ); + addItemStringList( "ViewNames", &mViewNames, QStringList(defaultView) ); KPrefs::setCurrentGroup( "Filters" ); addItemInt( "CurrentFilter", &mCurrentFilter, 0 ); diff --git a/kaddressbook/kabprefs.h b/kaddressbook/kabprefs.h index ddbc0c0..aff725e 100644 --- a/kaddressbook/kabprefs.h +++ b/kaddressbook/kabprefs.h @@ -24,9 +24,11 @@ #ifndef KABPREFS_H #define KABPREFS_H #include <qstringlist.h> -#include <qdict.h> +#include <q3dict.h> +//Added by qt3to4: +#include <Q3ValueList> #include <libkdepim/kpimprefs.h> class KConfig; @@ -72,10 +74,10 @@ class KABPrefs : public KPimPrefs bool mSearchWithReturn; bool mAutoSearchWithWildcard; bool mHideSearchOnSwitch; bool mAskForDelete; - QValueList<int> mExtensionsSplitter; - QValueList<int> mDetailsSplitter; + Q3ValueList<int> mExtensionsSplitter; + Q3ValueList<int> mDetailsSplitter; // Extensions stuff int mCurrentExtension; QStringList mActiveExtensions; diff --git a/kaddressbook/kaddressbook.pro b/kaddressbook/kaddressbook.pro index cd38e5f..4eb1f7f 100644 --- a/kaddressbook/kaddressbook.pro +++ b/kaddressbook/kaddressbook.pro @@ -12,42 +12,42 @@ DEFINES += KAB_EMBEDDED KAB_NOSPLITTER DESKTOP_VERSION unix : { staticlib: { TARGET = kapi_linux -LIBS += ../bin/libmicrokabc_qtopia.a -LIBS += ../bin/libmicrokabc_file.a -LIBS += ../bin/libmicrokabc_dir.a -LIBS += ../bin/libmicrokdepim.a -LIBS += ../bin/libmicrokcal.a -LIBS += ../bin/libmicrokabc.a -LIBS += ../bin/libmicrokde.a -LIBS += ../bin/libmicrokabc_qtopia.a -LIBS += ../bin/libmicrokabc_file.a -LIBS += ../bin/libmicrokabc_dir.a -LIBS += ../bin/libmicrokdepim.a -LIBS += ../bin/libmicrokcal.a -LIBS += ../bin/libmicrokabc.a -LIBS += ../bin/libmicrokde.a +LIBS += ../bin/libxmicrokabc_qtopia.a +LIBS += ../bin/libxmicrokabc_file.a +LIBS += ../bin/libxmicrokabc_dir.a +LIBS += ../bin/libxmicrokdepim.a +LIBS += ../bin/libxmicrokcal.a +LIBS += ../bin/libxmicrokabc.a +LIBS += ../bin/libxmicrokde.a +LIBS += ../bin/libxmicrokabc_qtopia.a +LIBS += ../bin/libxmicrokabc_file.a +LIBS += ../bin/libxmicrokabc_dir.a +LIBS += ../bin/libxmicrokdepim.a +LIBS += ../bin/libxmicrokcal.a +LIBS += ../bin/libxmicrokabc.a +LIBS += ../bin/libxmicrokde.a LIBS += ../libical/lib/libical.a LIBS += ../libical/lib/libicalss.a } else { -LIBS += ../bin/libmicrokdepim.so -LIBS += ../bin/libmicrokde.so -LIBS += ../bin/libmicrokabc.so -LIBS += ../bin/libmicrokcal.so +LIBS += ../bin/libxmicrokdepim.so +LIBS += ../bin/libxmicrokde.so +LIBS += ../bin/libxmicrokabc.so +LIBS += ../bin/libxmicrokcal.so #LIBS += -lldap } OBJECTS_DIR = obj/unix MOC_DIR = moc/unix } win32: { RC_FILE = winicons.rc DEFINES += _WIN32_ -LIBS += ../bin/microkdepim.lib -LIBS += ../bin/microkcal.lib -LIBS += ../bin/microkde.lib -LIBS += ../bin/microkabc.lib +LIBS += ../bin/xmicrokdepim.lib +LIBS += ../bin/xmicrokcal.lib +LIBS += ../bin/xmicrokde.lib +LIBS += ../bin/xmicrokabc.lib QMAKE_LINK += /NODEFAULTLIB:LIBC OBJECTS_DIR = obj/win MOC_DIR = moc/win #olimport section @@ -203,4 +203,6 @@ xxport/sharpdtm_xxport.cpp \ #mainwindow.cpp \ # calendarview.cpp \ # timespanview.cpp +#The following line was inserted by qt3to4 +QT += xml qt3support diff --git a/kaddressbook/kaddressbookE.pro b/kaddressbook/kaddressbookE.pro index 64e3a4a..c4b2499 100644 --- a/kaddressbook/kaddressbookE.pro +++ b/kaddressbook/kaddressbookE.pro @@ -11,12 +11,12 @@ INCLUDEPATH += . ./details ./features ./xxport ../libkdepim ../microkde ../micro DEFINES += KAB_EMBEDDED KAB_NOSPLITTER #DEFINES += KORG_NODND KORG_NOPLUGINS KORG_NOKABC KORG_NOARCHIVE KORG_NOMAIL #DEFINES += KORG_NOPRINTER KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER #DEFINES += KORG_NOLVALTERNATION -LIBS += -lmicrokdepim -LIBS += -lmicrokde +LIBS += -lxmicrokdepim +LIBS += -lxmicrokde LIBS += -lmicroqtcompat -LIBS += -lmicrokabc +LIBS += -lxmicrokabc LIBS += -lqpe LIBS += -ljpeg LIBS += $(QTOPIALIB) LIBS += -L$(QPEDIR)/lib diff --git a/kaddressbook/kaddressbookmain.cpp b/kaddressbook/kaddressbookmain.cpp index c417226..b317974 100644 --- a/kaddressbook/kaddressbookmain.cpp +++ b/kaddressbook/kaddressbookmain.cpp @@ -24,10 +24,13 @@ #ifdef KAB_EMBEDDED #include "kabprefs.h" #include <kglobal.h> #include <qmessagebox.h> -#include <qtoolbar.h> +#include <q3toolbar.h> #include <qapplication.h> +//Added by qt3to4: +#include <Q3CString> +#include <QCloseEvent> #else //KAB_EMBEDDED #include <kedittoolbar.h> #include <kkeydialog.h> #include <kmessagebox.h> @@ -41,20 +44,20 @@ #ifdef KAB_EMBEDDED KAddressBookMain::KAddressBookMain() : KMainWindow( 0, "abmain" ) #else //KAB_EMBEDDED -//MOC_SKIP_BEGIN +#ifndef Q_MOC_RUN KAddressBookMain::KAddressBookMain() : DCOPObject( "KAddressBookIface" ), KMainWindow( 0 ) -//MOC_SKIP_END +#endif #endif //KAB_EMBEDDED { setIcon(SmallIcon( "ka24" ) ); #if 0 //US for embedded systems, create the toolbar before we initiate KABCore. // KABCore will fill the toolbar with menues and icons - QMainWindow::ToolBarDock tbd; - tbd = Top; - iconToolBar = new QToolBar( this ); + Qt::ToolBarDock tbd; + tbd = Qt::DockTop; + iconToolBar = new Q3ToolBar( this ); addToolBar (iconToolBar , tbd ); iconToolBar->setHorizontalStretchable(true); //US iconToolBar->setWidth(300); #endif // 0 @@ -84,9 +87,9 @@ KAddressBookMain::KAddressBookMain() : DCOPObject( "KAddressBookIface" ), KMainW #endif //KAB_EMBEDDED setAutoSaveSettings(); mCore->restoreSettings(); #ifndef DESKTOP_VERSION - QObject::connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), mCore, SLOT (receiveStart ( const QCString &, const QByteArray & ))); + QObject::connect(qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), mCore, SLOT (receiveStart ( const Q3CString &, const QByteArray & ))); #endif } KAddressBookMain::~KAddressBookMain() @@ -234,8 +237,7 @@ void KAddressBookMain::closeEvent( QCloseEvent* ce ) ce->accept(); } -#ifndef KAB_EMBEDDED -#include "kaddressbookmain.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_kaddressbookmain.cpp" #endif //KAB_EMBEDDED - diff --git a/kaddressbook/kaddressbookmain.h b/kaddressbook/kaddressbookmain.h index b6d9b4b..d3f5cc7 100644 --- a/kaddressbook/kaddressbookmain.h +++ b/kaddressbook/kaddressbookmain.h @@ -23,12 +23,14 @@ #ifndef KADDRESSBOOKMAIN_H #define KADDRESSBOOKMAIN_H -#include <qptrlist.h> +#include <q3ptrlist.h> +//Added by qt3to4: +#include <QCloseEvent> #ifdef KAB_EMBEDDED -class QToolBar; +class Q3ToolBar; #include <qaction.h> //#include <qmainwindow.h> #include <kmainwindow.h> #else //KAB_EMBEDDED @@ -51,11 +53,11 @@ class KConfig; */ #ifdef KAB_EMBEDDED class KAddressBookMain : public KMainWindow #else //KAB_EMBEDDED -//MOC_SKIP_BEGIN +#ifndef Q_MOC_RUN class KAddressBookMain : public KMainWindow, virtual public KAddressBookIface -//MOC_SKIP_END +#endif #endif //KAB_EMBEDDED { Q_OBJECT @@ -72,11 +74,11 @@ class KAddressBookMain : public KMainWindow, virtual public KAddressBookIface public slots: void showMinimized () ; virtual void addEmail( QString addr ); #ifndef KAB_EMBEDDED -//MOC_SKIP_BEGIN +#ifndef Q_MOC_RUN virtual ASYNC showContactEditor( QString uid ); -//MOC_SKIP_END +#endif #endif //KAB_EMBEDDED virtual void newContact(); virtual QString getNameByPhone( QString phone ); virtual void save(); diff --git a/kaddressbook/kaddressbookview.cpp b/kaddressbook/kaddressbookview.cpp index 86898e2..4823b37 100644 --- a/kaddressbook/kaddressbookview.cpp +++ b/kaddressbook/kaddressbookview.cpp @@ -31,8 +31,10 @@ #include "viewmanager.h" #endif //KAB_EMBEDDED #include <qlayout.h> +//Added by qt3to4: +#include <Q3VBoxLayout> #include <kabc/distributionlistdialog.h> #include <kabc/addressbook.h> #include <kdebug.h> @@ -132,9 +134,9 @@ KABC::Addressee::List KAddressBookView::addressees() void KAddressBookView::initGUI() { // Create the layout - QVBoxLayout *layout = new QVBoxLayout( this ); + Q3VBoxLayout *layout = new Q3VBoxLayout( this ); // Add the view widget mViewWidget = new QWidget( this ); layout->addWidget( mViewWidget ); @@ -182,7 +184,7 @@ ViewConfigureWidget *ViewFactory::configureWidget( KABC::AddressBook *ab, } -#ifndef KAB_EMBEDDED -#include "kaddressbookview.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_kaddressbookview.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/kaddressbookview.h b/kaddressbook/kaddressbookview.h index 3a3f71a..e423cd7 100644 --- a/kaddressbook/kaddressbookview.h +++ b/kaddressbook/kaddressbookview.h @@ -1,4 +1,6 @@ +//Added by qt3to4: +#include <QDropEvent> /* This file is part of KAddressBook. Copyright (c) 2002 Mike Pilone <mpilone@slac.com> @@ -39,9 +41,9 @@ class QDropEvent; #include "viewconfigurewidget.h" #include "filter.h" #ifdef DESKTOP_VERSION -#include <qpaintdevicemetrics.h> +#include <q3paintdevicemetrics.h> #include <qprinter.h> #include <qpainter.h> #endif @@ -174,11 +176,11 @@ class KAddressBookView : public QWidget the addressee matching <i>uid</i>. If uid is equal to QString::null, then all addressees should be selected. */ #ifndef KAB_EMBEDDED -//MOC_SKIP_BEGIN +#ifndef Q_MOC_RUN virtual void setSelected( QString uid = QString::null, bool selected = true ) = 0; -//MOC_SKIP_END +#endif #else //KAB_EMBEDDED //US my moc can not handle the default parameters. Is this a problem ??? virtual void setSelected( QString uid, bool selected) = 0; #endif //KAB_EMBEDDED @@ -261,11 +263,11 @@ class KAddressBookView : public QWidget QWidget *mViewWidget; }; #ifndef KAB_EMBEDDED -//MOC_SKIP_BEGIN +#ifndef Q_MOC_RUN class ViewFactory : public KLibFactory -//MOC_SKIP_END +#endif #else //KAB_EMBEDDED class ViewFactory #endif //KAB_EMBEDDED { diff --git a/kaddressbook/kcmconfigs/addresseewidget.cpp b/kaddressbook/kcmconfigs/addresseewidget.cpp index 168d39e..8055085 100644 --- a/kaddressbook/kcmconfigs/addresseewidget.cpp +++ b/kaddressbook/kcmconfigs/addresseewidget.cpp @@ -20,14 +20,18 @@ with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ -#include <qgroupbox.h> +#include <q3groupbox.h> #include <qlabel.h> #include <qlayout.h> -#include <qlistbox.h> +#include <q3listbox.h> #include <qpushbutton.h> #include <qapplication.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3HBoxLayout> #include <kbuttonbox.h> #include <kcombobox.h> #include <kconfig.h> @@ -44,15 +48,15 @@ NamePartWidget::NamePartWidget( const QString &title, QWidget *parent, : QWidget( parent, name ) { if (KGlobal::getOrientation() == KGlobal::Portrait) { - QGridLayout* layout = new QGridLayout( this, 1, 1, KDialog::marginHintSmall(), + Q3GridLayout* layout = new Q3GridLayout( this, 1, 1, KDialog::marginHintSmall(), KDialog::spacingHintSmall() ); QLabel *label = new QLabel( i18n( title ), this ); layout->addWidget( label, 0, 1 ); - mBox = new QListBox( this ); + mBox = new Q3ListBox( this ); mBox->setMaximumSize(70, 70); layout->addMultiCellWidget( mBox, 0, 1, 0, 0 ); KButtonBox *bbox = new KButtonBox( this, Qt::Vertical ); @@ -69,15 +73,15 @@ NamePartWidget::NamePartWidget( const QString &title, QWidget *parent, } else { - QHBoxLayout *layout = new QHBoxLayout( this ); + Q3HBoxLayout *layout = new Q3HBoxLayout( this ); - QGroupBox *group = new QGroupBox( 0, Qt::Vertical, title, this ); - QGridLayout *groupLayout = new QGridLayout( group->layout(), 2, 2, + Q3GroupBox *group = new Q3GroupBox( 0, Qt::Vertical, title, this ); + Q3GridLayout *groupLayout = new Q3GridLayout( group->layout(), 2, 2, KDialog::spacingHint() ); - mBox = new QListBox( group ); + mBox = new Q3ListBox( group ); groupLayout->addWidget( mBox, 0, 0 ); KButtonBox *bbox = new KButtonBox( group, Qt::Vertical ); @@ -96,10 +100,10 @@ NamePartWidget::NamePartWidget( const QString &title, QWidget *parent, mAddButton->setEnabled( false ); mRemoveButton->setEnabled( false ); - connect( mBox, SIGNAL( selectionChanged( QListBoxItem* ) ), - SLOT( selectionChanged( QListBoxItem* ) ) ); + connect( mBox, SIGNAL( selectionChanged( Q3ListBoxItem* ) ), + SLOT( selectionChanged( Q3ListBoxItem* ) ) ); connect( mEdit, SIGNAL( textChanged( const QString& ) ), SLOT( textChanged( const QString& ) ) ); connect( mEdit, SIGNAL( returnPressed() ), SLOT( add() ) ); @@ -142,9 +146,9 @@ void NamePartWidget::remove() emit modified(); } -void NamePartWidget::selectionChanged( QListBoxItem *item ) +void NamePartWidget::selectionChanged( Q3ListBoxItem *item ) { mRemoveButton->setEnabled( item != 0 ); } @@ -156,9 +160,9 @@ void NamePartWidget::textChanged( const QString& text ) AddresseeWidget::AddresseeWidget( QWidget *parent, const char *name ) : QWidget( parent, name ) { - QGridLayout *layout; + Q3GridLayout *layout; mPrefix = new NamePartWidget( i18n( "Prefixes" ), this ); mInclusion = new NamePartWidget( i18n( "Inclusions" ), this ); mSuffix = new NamePartWidget( i18n( "Suffixes" ), this ); @@ -177,9 +181,9 @@ AddresseeWidget::AddresseeWidget( QWidget *parent, const char *name ) mFormattedNameCombo->insertItem( i18n( "Reverse Name" ) ); if (KGlobal::getOrientation() == KGlobal::Portrait) { - layout = new QGridLayout( this, 4, 2, KDialog::marginHintSmall(), + layout = new Q3GridLayout( this, 4, 2, KDialog::marginHintSmall(), KDialog::spacingHintSmall() ); layout->addMultiCellWidget( mPrefix, 0, 0, 0, 1 ); layout->addMultiCellWidget( mInclusion, 1, 1, 0, 1 ); @@ -189,9 +193,9 @@ AddresseeWidget::AddresseeWidget( QWidget *parent, const char *name ) } else { - layout = new QGridLayout( this, 2, 3, KDialog::marginHint(), + layout = new Q3GridLayout( this, 2, 3, KDialog::marginHint(), KDialog::spacingHint() ); layout->addWidget( mPrefix, 0, 0 ); layout->addWidget( mInclusion, 0, 1 ); @@ -232,7 +236,7 @@ void AddresseeWidget::saveSettings() config.writeEntry( "Suffixes", mSuffix->nameParts() ); config.writeEntry( "FormattedNameType", mFormattedNameCombo->currentItem() ); } -#ifndef KAB_EMBEDDED -#include "addresseewidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_addresseewidget.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/kcmconfigs/addresseewidget.h b/kaddressbook/kcmconfigs/addresseewidget.h index 09330c8..f2a95a8 100644 --- a/kaddressbook/kcmconfigs/addresseewidget.h +++ b/kaddressbook/kcmconfigs/addresseewidget.h @@ -28,10 +28,10 @@ class KComboBox; class KLineEdit; -class QListBox; -class QListBoxItem; +class Q3ListBox; +class Q3ListBoxItem; class QPushButton; class NamePartWidget : public QWidget { @@ -51,15 +51,15 @@ class NamePartWidget : public QWidget private slots: void add(); void remove(); - void selectionChanged( QListBoxItem* ); + void selectionChanged( Q3ListBoxItem* ); void textChanged( const QString& ); private: KLineEdit *mEdit; - QListBox *mBox; + Q3ListBox *mBox; QPushButton *mAddButton; QPushButton *mRemoveButton; }; diff --git a/kaddressbook/kcmconfigs/extensionconfigdialog.cpp b/kaddressbook/kcmconfigs/extensionconfigdialog.cpp index e87b000..33b66ad 100644 --- a/kaddressbook/kcmconfigs/extensionconfigdialog.cpp +++ b/kaddressbook/kcmconfigs/extensionconfigdialog.cpp @@ -21,8 +21,11 @@ without including the source code for Qt in the source distribution. */ #include <qlayout.h> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3Frame> #include <klocale.h> #include "configurewidget.h" @@ -33,10 +36,10 @@ ExtensionConfigDialog::ExtensionConfigDialog( ExtensionFactory *factory, KConfig QWidget *parent, const char *name ) : KDialogBase( Plain, i18n( "Extension Settings" ), Ok | Cancel, Ok, parent, name, true, true ), mWidget( 0 ), mConfig( config ) { - QFrame *page = plainPage(); - QGridLayout *layout = new QGridLayout( page, 1, 1, marginHint(), spacingHint() ); + Q3Frame *page = plainPage(); + Q3GridLayout *layout = new Q3GridLayout( page, 1, 1, marginHint(), spacingHint() ); mWidget = factory->configureWidget( page, "ExtensionConfigWidget" ); layout->addWidget( mWidget, 0, 0 ); @@ -53,7 +56,7 @@ void ExtensionConfigDialog::slotOk() KDialogBase::slotOk(); } -#ifndef KAB_EMBEDDED -#include "extensionconfigdialog.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_extensionconfigdialog.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.cpp b/kaddressbook/kcmconfigs/kabconfigwidget.cpp index 9e4db74..d2b7ef1 100644 --- a/kaddressbook/kcmconfigs/kabconfigwidget.cpp +++ b/kaddressbook/kcmconfigs/kabconfigwidget.cpp @@ -21,18 +21,22 @@ without including the source code for Qt in the source distribution. */ #include <qcheckbox.h> -#include <qframe.h> -#include <qgroupbox.h> +#include <q3frame.h> +#include <q3groupbox.h> #include <qlayout.h> #include <qpushbutton.h> #include <qtabwidget.h> #include <qcombobox.h> #include <qlineedit.h> #include <qlabel.h> #include <qfile.h> -#include <qvbox.h> +#include <q3vbox.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3PtrList> +#include <Q3VBoxLayout> #include <kconfig.h> #include <kdebug.h> #include <kdialog.h> @@ -56,17 +60,17 @@ #include "kabconfigwidget.h" #include <kglobalsettings.h> -class ExtensionItem : public QCheckListItem +class ExtensionItem : public Q3CheckListItem { public: #ifndef KAB_EMBEDDED - ExtensionItem( QListView *parent, const QString &text ); + ExtensionItem( Q3ListView *parent, const QString &text ); void setService( const KService::Ptr &ptr ); #else //KAB_EMBEDDED - ExtensionItem( QListView *parent, const QString &text, const QString &name, const QString &comment ); + ExtensionItem( Q3ListView *parent, const QString &text, const QString &name, const QString &comment ); void setFactory( ExtensionFactory* fac ); #endif //KAB_EMBEDDED bool configWidgetAvailable() const; @@ -89,22 +93,22 @@ class ExtensionItem : public QCheckListItem KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char *name ) : KPrefsWidget( prefs, parent, name ) { - QVBoxLayout *topLayout = new QVBoxLayout( this, 0, + Q3VBoxLayout *topLayout = new Q3VBoxLayout( this, 0, KDialog::spacingHintSmall() ); QTabWidget *tabWidget = new QTabWidget( this ); topLayout->addWidget( tabWidget ); // General page QWidget *generalPage = new QWidget( this ); - QVBoxLayout *layout = new QVBoxLayout( generalPage, KDialog::marginHintSmall(), + Q3VBoxLayout *layout = new Q3VBoxLayout( generalPage, KDialog::marginHintSmall(), KDialog::spacingHintSmall() ); QWidget *hBox = new QWidget( generalPage, "qhbox" ); - QHBoxLayout *hboxLayout = new QHBoxLayout( hBox); + Q3HBoxLayout *hboxLayout = new Q3HBoxLayout( hBox); KPrefsWidFont *detailsFont = addWidFont(i18n("phone:123"),i18n("Details view font"), &(KABPrefs::instance()->mDetailsFont),hBox); hboxLayout->addWidget(detailsFont->label()); @@ -116,9 +120,9 @@ KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char * layout->addWidget( hBox ); //general groupbox QWidget *vBox = new QWidget( generalPage, "qvbox" ); - QVBoxLayout *boxLayout = new QVBoxLayout( vBox ); + Q3VBoxLayout *boxLayout = new Q3VBoxLayout( vBox ); boxLayout->setAlignment( Qt::AlignTop ); boxLayout->setMargin(KDialog::marginHintSmall() ); boxLayout->setSpacing( KDialog::spacingHintSmall() ); mMenuBarBox = new QCheckBox( i18n( "Full Menu bar (restart)" ), vBox, "mremenuturn" ); @@ -153,15 +157,15 @@ KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char * tabWidget->addTab( generalPage, i18n( "General" ) ); // Extension page QWidget *extensionPage = new QWidget( this ); - QVBoxLayout *extensionLayout = new QVBoxLayout( extensionPage, KDialog::marginHintSmall(), + Q3VBoxLayout *extensionLayout = new Q3VBoxLayout( extensionPage, KDialog::marginHintSmall(), KDialog::spacingHintSmall() ); //extensions groupbox - QGroupBox* groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Extensions (restart)" ), extensionPage ); - boxLayout = new QVBoxLayout( groupBox->layout() ); + Q3GroupBox* groupBox = new Q3GroupBox( 0, Qt::Vertical, i18n( "Extensions (restart)" ), extensionPage ); + boxLayout = new Q3VBoxLayout( groupBox->layout() ); boxLayout->setAlignment( Qt::AlignTop ); boxLayout->setMargin(KDialog::marginHintSmall()); boxLayout->setSpacing(KDialog::spacingHintSmall()); groupBox->layout()->setMargin(1) ; @@ -188,12 +192,12 @@ KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char * connect( mHideSearchOnSwitchBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); connect( mMultipleViewsAtOnce, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); connect( mAskForQuit, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); connect( mAskForDelete, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); - connect( mExtensionView, SIGNAL( selectionChanged( QListViewItem* ) ), - SLOT( selectionChanged( QListViewItem* ) ) ); - connect( mExtensionView, SIGNAL( clicked( QListViewItem* ) ), - SLOT( itemClicked( QListViewItem* ) ) ); + connect( mExtensionView, SIGNAL( selectionChanged( Q3ListViewItem* ) ), + SLOT( selectionChanged( Q3ListViewItem* ) ) ); + connect( mExtensionView, SIGNAL( clicked( Q3ListViewItem* ) ), + SLOT( itemClicked( Q3ListViewItem* ) ) ); connect( mConfigureButton, SIGNAL( clicked() ), SLOT( configureExtension() ) ); tabWidget->addTab( extensionPage, i18n( "Extensions" ) ); @@ -294,10 +298,10 @@ void KABConfigWidget::restoreExtensionSettings() void KABConfigWidget::saveExtensionSettings() { QStringList activeExtensions; - QPtrList<QListViewItem> list; - QListViewItemIterator it( mExtensionView ); + Q3PtrList<Q3ListViewItem> list; + Q3ListViewItemIterator it( mExtensionView ); while ( it.current() ) { ExtensionItem *item = static_cast<ExtensionItem*>( it.current() ); if ( item ) { if ( item->isOn() ) @@ -327,36 +331,36 @@ void KABConfigWidget::configureExtension() config.sync(); } -void KABConfigWidget::selectionChanged( QListViewItem *i ) +void KABConfigWidget::selectionChanged( Q3ListViewItem *i ) { ExtensionItem *item = static_cast<ExtensionItem*>( i ); if ( !item ) return; mConfigureButton->setEnabled( item->configWidgetAvailable() ); } -void KABConfigWidget::itemClicked( QListViewItem *item ) +void KABConfigWidget::itemClicked( Q3ListViewItem *item ) { if ( item != 0 ) modified(); } #ifndef KAB_EMBEDDED -ExtensionItem::ExtensionItem( QListView *parent, const QString &text ) - : QCheckListItem( parent, text, CheckBox ) +ExtensionItem::ExtensionItem( Q3ListView *parent, const QString &text ) + : Q3CheckListItem( parent, text, CheckBox ) { } void ExtensionItem::setService( const KService::Ptr &ptr ) { mPtr = ptr; } #else //KAB_EMBEDDED -ExtensionItem::ExtensionItem( QListView *parent, const QString &text, const QString &name, const QString &comment ) - : QCheckListItem( parent, text, CheckBox ) +ExtensionItem::ExtensionItem( Q3ListView *parent, const QString &text, const QString &name, const QString &comment ) + : Q3CheckListItem( parent, text, CheckBox ) { mName = name; mComment = comment; } @@ -417,8 +421,7 @@ QString ExtensionItem::text( int column ) const return QString::null; #endif //KAB_EMBEDDED } -#ifndef KAB_EMBEDDED -#include "kabconfigwidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_kabconfigwidget.cpp" #endif //KAB_EMBEDDED - diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.h b/kaddressbook/kcmconfigs/kabconfigwidget.h index f2a6b1b..4b6e58c 100644 --- a/kaddressbook/kcmconfigs/kabconfigwidget.h +++ b/kaddressbook/kcmconfigs/kabconfigwidget.h @@ -26,9 +26,9 @@ #include <kprefswidget.h> class QCheckBox; -class QListViewItem; +class Q3ListViewItem; class QPushButton; class QComboBox; class QLineEdit; class KListView; @@ -52,10 +52,10 @@ class KABConfigWidget : public KPrefsWidget private slots: void configureExtension(); - void selectionChanged( QListViewItem* ); - void itemClicked( QListViewItem* ); + void selectionChanged( Q3ListViewItem* ); + void itemClicked( Q3ListViewItem* ); private: void restoreExtensionSettings(); void saveExtensionSettings(); diff --git a/kaddressbook/kcmconfigs/kcmkabconfig.cpp b/kaddressbook/kcmconfigs/kcmkabconfig.cpp index cbfedbd..55ffcd8 100644 --- a/kaddressbook/kcmconfigs/kcmkabconfig.cpp +++ b/kaddressbook/kcmconfigs/kcmkabconfig.cpp @@ -21,8 +21,10 @@ without including the source code for Qt in the source distribution. */ #include <qlayout.h> +//Added by qt3to4: +#include <Q3VBoxLayout> #ifndef KAB_EMBEDDED #include <kaboutdata.h> #endif //KAB_EMBEDDED @@ -47,9 +49,9 @@ extern "C" KCMKabConfig::KCMKabConfig( QWidget *parent, const char *name ) : KCModule( KABPrefs::instance(), parent, name ) { //abort(); - QVBoxLayout *layout = new QVBoxLayout( this ); + Q3VBoxLayout *layout = new Q3VBoxLayout( this ); mConfigWidget = new KABConfigWidget( (KABPrefs*)getPreferences(), this, "KABConfigWidget" ); layout->addWidget( mConfigWidget ); layout->setSpacing( 0 ); layout->setMargin( 0 ); @@ -86,7 +88,7 @@ const KAboutData* KCMKabConfig::aboutData() const } #endif //KAB_EMBEDDED -#ifndef KAB_EMBEDDED -#include "kcmkabconfig.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_kcmkabconfig.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/keywidget.cpp b/kaddressbook/keywidget.cpp index c117d34..8ebee19 100644 --- a/kaddressbook/keywidget.cpp +++ b/kaddressbook/keywidget.cpp @@ -27,17 +27,19 @@ #include <qlabel.h> #include <qlayout.h> #include <qpushbutton.h> +//Added by qt3to4: +#include <Q3GridLayout> #ifndef KAB_EMBEDDED #include <kaccelmanager.h> #include <kio/netaccess.h> #include <kmessagebox.h> #else //KAB_EMBEDDED #include <qmap.h> #include <qmessagebox.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <kurl.h> #endif //KAB_EMBEDDED #include <kapplication.h> @@ -51,9 +53,9 @@ KeyWidget::KeyWidget( QWidget *parent, const char *name ) : QWidget( parent, name ) { - QGridLayout *layout = new QGridLayout( this, 2, 2, KDialog::marginHint(), + Q3GridLayout *layout = new Q3GridLayout( this, 2, 2, KDialog::marginHint(), KDialog::spacingHint() ); QLabel *label = new QLabel( i18n( "Keys:" ), this ); layout->addWidget( label, 0, 0 ); @@ -135,9 +137,9 @@ void KeyWidget::addKey() QString tmpFile; if ( KIO::NetAccess::download( url, tmpFile ) ) { QFile file( tmpFile ); - if ( !file.open( IO_ReadOnly ) ) { + if ( !file.open( QIODevice::ReadOnly ) ) { QString text( i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ) ); KMessageBox::error( this, text.arg( url.url() ) ); return; } @@ -151,9 +153,9 @@ void KeyWidget::addKey() return; { QFile file( keyfile ); - if ( !file.open( IO_ReadOnly ) ) { + if ( !file.open( QIODevice::ReadOnly ) ) { QString text( i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ) ); QString caption( i18n( "Error" ) ); QMessageBox::critical( this, caption, text.arg( keyfile ) ); return; @@ -162,12 +164,12 @@ void KeyWidget::addKey() #endif //KAB_EMBEDDED - QTextStream s( &file ); + Q3TextStream s( &file ); QString data; - s.setEncoding( QTextStream::UnicodeUTF8 ); + s.setEncoding( Q3TextStream::UnicodeUTF8 ); s >> data; file.close(); KABC::Key key( data, type ); @@ -220,10 +222,10 @@ void KeyWidget::exportKey() #ifndef KAB_EMBEDDED KURL url = KFileDialog::getSaveURL(); KTempFile tempFile; - QTextStream *s = tempFile.textStream(); - s->setEncoding( QTextStream::UnicodeUTF8 ); + Q3TextStream *s = tempFile.textStream(); + s->setEncoding( Q3TextStream::UnicodeUTF8 ); (*s) << key.textData(); tempFile.close(); KIO::NetAccess::upload( tempFile.name(), url, kapp->mainWidget() ); @@ -234,17 +236,17 @@ void KeyWidget::exportKey() if ( keyfile.isEmpty() ) return; QFile file( keyfile ); - if ( !file.open( IO_ReadWrite ) ) { + if ( !file.open( QIODevice::ReadWrite ) ) { QString text( i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ) ); QString caption( i18n( "Error" ) ); QMessageBox::critical( this, caption, text.arg( keyfile ) ); return; } - QTextStream s( &file ); - s.setEncoding( QTextStream::UnicodeUTF8 ); + Q3TextStream s( &file ); + s.setEncoding( Q3TextStream::UnicodeUTF8 ); s << key.textData(); file.close(); @@ -271,7 +273,7 @@ void KeyWidget::updateKeyCombo() mRemoveButton->setEnabled( state ); mExportButton->setEnabled( state ); } -#ifndef KAB_EMBEDDED -#include "keywidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_keywidget.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp index 2f3531d..e373105 100644 --- a/kaddressbook/mainembedded.cpp +++ b/kaddressbook/mainembedded.cpp @@ -4,10 +4,9 @@ #include <stdlib.h> #else #include <qapplication.h> #include <qwindowsstyle.h> -#include <qplatinumstyle.h> -#include <qmainwindow.h> +#include <q3mainwindow.h> #include <qmessagebox.h> #include <stdlib.h> #endif @@ -23,14 +22,14 @@ #include <libkdepim/kpimglobalprefs.h> void dumpMissing(); int main( int argc, char **argv ) { + if(!getenv("QPEDIR")) putenv("QPEDIR=/usr/lib/kdepimpi"); #ifndef DESKTOP_VERSION QPEApplication a( argc, argv ); a.setKeepRunning (); #else QApplication a( argc, argv ); - QApplication::setStyle( new QPlatinumStyle ()); #ifdef _WIN32_ QString hdir ( getenv( "HOME") ); if ( hdir.isEmpty() ) { QString hd ("C:/" ); diff --git a/kaddressbook/nameeditdialog.cpp b/kaddressbook/nameeditdialog.cpp index 199f3d6..96822d8 100644 --- a/kaddressbook/nameeditdialog.cpp +++ b/kaddressbook/nameeditdialog.cpp @@ -22,14 +22,16 @@ */ #include <qlayout.h> #include <qlabel.h> -#include <qlistbox.h> -#include <qlistview.h> +#include <q3listbox.h> +#include <q3listview.h> #include <qtooltip.h> #include <qpushbutton.h> #include <qcheckbox.h> #include <qstring.h> +//Added by qt3to4: +#include <Q3GridLayout> #ifndef KAB_EMBEDDED #include <kaccelmanager.h> #else //KAB_EMBEDDED @@ -56,9 +58,9 @@ NameEditDialog::NameEditDialog( const KABC::Addressee &addr, int type, Ok, parent, name, true ) { QWidget *page = plainPage(); - QGridLayout *layout = new QGridLayout( page, 5, 3 ); + Q3GridLayout *layout = new Q3GridLayout( page, 5, 3 ); layout->setSpacing( spacingHint() ); layout->addColSpacing( 2, 100 ); QLabel *label; @@ -294,7 +296,7 @@ void NameEditDialog::slotHelp() qDebug("NameEditDialog::slotHelp Help is not supported yet"); #endif //KAB_EMBEDDED } -#ifndef KAB_EMBEDDED -#include "nameeditdialog.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_nameeditdialog.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/old_mainwindow.cpp b/kaddressbook/old_mainwindow.cpp index 0e886d9..7a445c7 100644 --- a/kaddressbook/old_mainwindow.cpp +++ b/kaddressbook/old_mainwindow.cpp @@ -315,15 +315,15 @@ void MainWindow::initActions() { iconToolBar->clear(); KABPrefs *p = KABPrefs::instance(); QPEMenuBar *menuBar1 = new QPEMenuBar( iconToolBar ); - QPopupMenu *menuBar = new QPopupMenu( this ); + Q3PopupMenu *menuBar = new Q3PopupMenu( this ); menuBar1->insertItem( "ME", menuBar); - QPopupMenu *fileMenu = new QPopupMenu( this ); - QPopupMenu *editMenu = new QPopupMenu( this ); - QPopupMenu *viewMenu = new QPopupMenu( this ); - QPopupMenu *settingsMenu = new QPopupMenu( this ); - QPopupMenu *importMenu = new QPopupMenu( this ); + Q3PopupMenu *fileMenu = new Q3PopupMenu( this ); + Q3PopupMenu *editMenu = new Q3PopupMenu( this ); + Q3PopupMenu *viewMenu = new Q3PopupMenu( this ); + Q3PopupMenu *settingsMenu = new Q3PopupMenu( this ); + Q3PopupMenu *importMenu = new Q3PopupMenu( this ); menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); QIconSet icon; diff --git a/kaddressbook/phoneeditwidget.cpp b/kaddressbook/phoneeditwidget.cpp index df3b551..3661677 100644 --- a/kaddressbook/phoneeditwidget.cpp +++ b/kaddressbook/phoneeditwidget.cpp @@ -26,15 +26,21 @@ #include <qtooltip.h> #include <qpushbutton.h> #include <qcheckbox.h> #include <qstring.h> -#include <qlistbox.h> -#include <qlistview.h> -#include <qbuttongroup.h> -#include <qhbox.h> +#include <q3listbox.h> +#include <q3listview.h> +#include <q3buttongroup.h> +#include <q3hbox.h> #include <qcursor.h> #include <qtimer.h> #include <qapplication.h> +//Added by qt3to4: +#include <Q3ValueList> +#include <Q3GridLayout> +#include <Q3Frame> +#include <Q3PopupMenu> +#include <Q3VBoxLayout> #include <kbuttonbox.h> #include <klistview.h> #include <kapplication.h> @@ -56,9 +62,9 @@ PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name ) : QWidget(parent,name) { - QGridLayout* gridLayout = new QGridLayout ( this, 2,2 ); + Q3GridLayout* gridLayout = new Q3GridLayout ( this, 2,2 ); QLabel *temp = new QLabel( "", this ); temp->setAlignment( Qt::AlignCenter ); temp->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) ); @@ -66,16 +72,16 @@ PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name ) addBut->setPixmap ( SmallIcon("plus")); addBut->setMaximumSize( addBut->sizeHint().height(),addBut->sizeHint().height() ); connect(addBut,SIGNAL(clicked ()),SLOT(addNumber())); - sv = new QScrollView( this ); - sv->setFrameStyle ( QFrame::Plain ); + sv = new Q3ScrollView( this ); + sv->setFrameStyle ( Q3Frame::Plain ); sv->setLineWidth ( 0 ); sv->setMidLineWidth ( 0 ); mw = new QWidget ( sv->viewport() ); sv->addChild(mw); - sv->setResizePolicy( QScrollView::AutoOneFit ); - mainLayout = new QVBoxLayout ( mw ); + sv->setResizePolicy( Q3ScrollView::AutoOneFit ); + mainLayout = new Q3VBoxLayout ( mw ); mainLayout->setMargin( 0 ); mainLayout->setSpacing( 0 ); gridLayout->setMargin( 2 ); gridLayout->setSpacing( 4 ); @@ -89,9 +95,9 @@ PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name ) gridLayout->addMultiCellWidget( sv, 0, 1, 1,1 ); } setDefaults(); mTypeNumberEditList.setAutoDelete( true ); - mPopup = new QPopupMenu( this ); + mPopup = new Q3PopupMenu( this ); QStringList list = PhoneNumber::supportedTypeListNames(); mPopupCount = list.count(); int i = 0; while ( i < mPopupCount ) { @@ -225,9 +231,9 @@ KABC::PhoneNumber::List PhoneEditWidget::phoneNumbers() #if 0 PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name ) : QWidget( parent, name ) { - QGridLayout *layout = new QGridLayout( this, 4, 1 ); + Q3GridLayout *layout = new Q3GridLayout( this, 4, 1 ); //US layout->setSpacing( KDialog::spacingHint() ); layout->setSpacing( KDialogBase::spacingHintSmall() ); @@ -235,9 +241,9 @@ PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name ) QLabel* label = new QLabel( this ); //US loadIcon call is ambiguous. Add one more parameter //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop ) ); label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) ); - label->setAlignment( AlignCenter ); + label->setAlignment( Qt::AlignCenter ); //US layout->addMultiCellWidget( label, 0, 1, 3, 3 ); layout->addWidget( label, 0, 0 ); QPushButton *editButton = new QPushButton( i18n( "Edit Phone Numbers..." ), @@ -326,9 +332,9 @@ void PhoneEditWidget::setPhoneNumbers( const KABC::PhoneNumber::List &list ) // Insert types for existing numbers. mPrefCombo->insertTypeList( list ); - QValueList<int> defaultTypes; + Q3ValueList<int> defaultTypes; defaultTypes << KABC::PhoneNumber::Home; defaultTypes << KABC::PhoneNumber::Work; defaultTypes << KABC::PhoneNumber::Cell; defaultTypes << ( KABC::PhoneNumber::Work | KABC::PhoneNumber::Fax ); @@ -336,9 +342,9 @@ void PhoneEditWidget::setPhoneNumbers( const KABC::PhoneNumber::List &list ) // Insert default types. // Doing this for mPrefCombo is enough because the list is shared by all // combos. - QValueList<int>::ConstIterator it; + Q3ValueList<int>::ConstIterator it; for( it = defaultTypes.begin(); it != defaultTypes.end(); ++it ) { if ( !mPrefCombo->hasType( *it ) ) mPrefCombo->insertType( list, *it, PhoneNumber( "", *it ) ); } @@ -486,12 +492,12 @@ void PhoneEditWidget::updateOtherEdit( PhoneTypeCombo *combo, PhoneTypeCombo *ot /////////////////////////////////////////// // PhoneEditDialog -class PhoneViewItem : public QListViewItem +class PhoneViewItem : public Q3ListViewItem { public: - PhoneViewItem( QListView *parent, const KABC::PhoneNumber &number ); + PhoneViewItem( Q3ListView *parent, const KABC::PhoneNumber &number ); void setPhoneNumber( const KABC::PhoneNumber &number ) { mPhoneNumber = number; @@ -510,10 +516,10 @@ private: KABC::PhoneNumber mPhoneNumber; }; -PhoneViewItem::PhoneViewItem( QListView *parent, const KABC::PhoneNumber &number ) - : QListViewItem( parent ), mPhoneNumber( number ) +PhoneViewItem::PhoneViewItem( Q3ListView *parent, const KABC::PhoneNumber &number ) + : Q3ListViewItem( parent ), mPhoneNumber( number ) { #ifdef DESKTOP_VERSION setRenameEnabled ( 0, true ); #endif @@ -543,17 +549,17 @@ PhoneEditDialog::PhoneEditDialog( const KABC::PhoneNumber::List &list, QWidget * mPhoneNumberList = list; QWidget *page = plainPage(); - QGridLayout *layout = new QGridLayout( page, 1, 2 ); + Q3GridLayout *layout = new Q3GridLayout( page, 1, 2 ); layout->setSpacing( spacingHint() ); mListView = new KListView( page ); mListView->setAllColumnsShowFocus( true ); mListView->addColumn( i18n( "Number" ) ); mListView->addColumn( i18n( "Type" ) ); - KButtonBox *buttonBox = new KButtonBox( page, Vertical ); + KButtonBox *buttonBox = new KButtonBox( page, Qt::Vertical ); buttonBox->addButton( i18n( "&Add..." ), this, SLOT( slotAddPhoneNumber() ) ); mEditButton = buttonBox->addButton( i18n( "&Edit..." ), this, SLOT( slotEditPhoneNumber() ) ); mEditButton->setEnabled( false ); @@ -564,9 +570,9 @@ PhoneEditDialog::PhoneEditDialog( const KABC::PhoneNumber::List &list, QWidget * layout->addWidget( mListView, 0, 0 ); layout->addWidget( buttonBox, 0, 1 ); connect( mListView, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged()) ); - connect( mListView, SIGNAL(doubleClicked( QListViewItem *, const QPoint &, int )), this, SLOT( slotEditPhoneNumber())); + connect( mListView, SIGNAL(doubleClicked( Q3ListViewItem *, const QPoint &, int )), this, SLOT( slotEditPhoneNumber())); KABC::PhoneNumber::List::Iterator it; for ( it = mPhoneNumberList.begin(); it != mPhoneNumberList.end(); ++it ) new PhoneViewItem( mListView, *it ); @@ -587,9 +593,9 @@ void PhoneEditDialog::slotAddPhoneNumber() KABC::PhoneNumber tmp( "", 0 ); PhoneTypeDialog dlg( tmp, this ); if ( dlg.exec() ) { - QListViewItem* i = mListView->firstChild(); + Q3ListViewItem* i = mListView->firstChild(); KABC::PhoneNumber phoneNumber = dlg.phoneNumber(); bool insert = true; while ( i ) { PhoneViewItem* p = ( PhoneViewItem* ) i; @@ -619,9 +625,9 @@ void PhoneEditDialog::slotRemovePhoneNumber() if ( !item ) return; mPhoneNumberList.remove( item->phoneNumber() ); - QListViewItem *currItem = mListView->currentItem(); + Q3ListViewItem *currItem = mListView->currentItem(); mListView->takeItem( currItem ); delete currItem; mChanged = true; @@ -672,9 +678,9 @@ PhoneTypeDialog::PhoneTypeDialog( const KABC::PhoneNumber &phoneNumber, parent, name, true), mPhoneNumber( phoneNumber ) { QWidget *page = plainPage(); QLabel *label = 0; - QGridLayout *layout = new QGridLayout( page, 3, 2, marginHint(), spacingHint() ); + Q3GridLayout *layout = new Q3GridLayout( page, 3, 2, marginHint(), spacingHint() ); label = new QLabel( i18n( "Number:" ), page ); layout->addWidget( label, 0, 0 ); mNumber = new KLineEdit( page ); @@ -682,9 +688,9 @@ PhoneTypeDialog::PhoneTypeDialog( const KABC::PhoneNumber &phoneNumber, mPreferredBox = new QCheckBox( i18n( "This is the preferred phone number" ), page ); layout->addMultiCellWidget( mPreferredBox, 1, 1, 0, 1 ); - mGroup = new QButtonGroup( 2, Horizontal, i18n( "Types" ), page ); + mGroup = new Q3ButtonGroup( 2, Qt::Horizontal, i18n( "Types" ), page ); layout->addMultiCellWidget( mGroup, 2, 2, 0, 1 ); // fill widgets mNumber->setText( mPhoneNumber.number() ); @@ -725,7 +731,7 @@ KABC::PhoneNumber PhoneTypeDialog::phoneNumber() return mPhoneNumber; } #endif -#ifndef KAB_EMBEDDED -#include "phoneeditwidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_phoneeditwidget.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/phoneeditwidget.h b/kaddressbook/phoneeditwidget.h index 5bb4226..2be3e2b 100644 --- a/kaddressbook/phoneeditwidget.h +++ b/kaddressbook/phoneeditwidget.h @@ -26,18 +26,22 @@ #include <kdialogbase.h> #include <kiconloader.h> #include <qpushbutton.h> #include <qlayout.h> -#include <qpopupmenu.h> +#include <q3popupmenu.h> #include <qapplication.h> +#include <QDesktopWidget> -#include <qptrlist.h> -#include <qscrollview.h> +#include <q3ptrlist.h> +#include <q3scrollview.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3VBoxLayout> #include "addresseeconfig.h" #include "typecombo.h" -class QButtonGroup; +class Q3ButtonGroup; class QCheckBox; class PhoneTypeNumberEdit; #include <klineedit.h> @@ -75,17 +79,17 @@ class PhoneEditWidget : public QWidget void pendingDelete(); protected: private: - QScrollView* sv; - QPopupMenu *mPopup; + Q3ScrollView* sv; + Q3PopupMenu *mPopup; int mPopupCount; PhoneTypeNumberEdit* mPendingDelete; void setDefaults(); PhoneTypeNumberEdit* appendEditCombo(); QWidget* mw; - QVBoxLayout* mainLayout; - QPtrList <PhoneTypeNumberEdit> mTypeNumberEditList; + Q3VBoxLayout* mainLayout; + Q3PtrList <PhoneTypeNumberEdit> mTypeNumberEditList; }; @@ -94,16 +98,16 @@ class PhoneTypeNumberEdit : public QWidget Q_OBJECT public: PhoneTypeNumberEdit( QWidget *parent, const char *name = 0 ) :QWidget( parent ) { - QHBoxLayout * lay = new QHBoxLayout( this ); + Q3HBoxLayout * lay = new Q3HBoxLayout( this ); lay->setSpacing( 2 ); lay->setMargin( 0 ); mMinusButton = new QPushButton ( this ); mMinusButton->setPixmap ( SmallIcon("minus")); mCombo = new KComboBox( this ); if ( QApplication::desktop()->width() <= 640 ) - mCombo->setSizeLimit ( 6 ); + mCombo->setMaxVisibleItems ( 6 ); mNumber = new KLineEdit( this ); mMinusButton->setMaximumHeight( mNumber->sizeHint().height() + 6); lay->addWidget( mMinusButton ); lay->addWidget( mCombo ); diff --git a/kaddressbook/secrecywidget.cpp b/kaddressbook/secrecywidget.cpp index 4a2acc8..1c237c0 100644 --- a/kaddressbook/secrecywidget.cpp +++ b/kaddressbook/secrecywidget.cpp @@ -21,8 +21,10 @@ without including the source code for Qt in the source distribution. */ #include <qlayout.h> +//Added by qt3to4: +#include <Q3VBoxLayout> #include <kabc/secrecy.h> #include <kcombobox.h> #include <kdialog.h> @@ -31,9 +33,9 @@ SecrecyWidget::SecrecyWidget( QWidget *parent, const char *name ) : QWidget( parent, name ) { - QVBoxLayout *layout = new QVBoxLayout( this, KDialog::marginHint(), + Q3VBoxLayout *layout = new Q3VBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() ); mSecrecyCombo = new KComboBox( this ); layout->addWidget( mSecrecyCombo ); @@ -64,7 +66,7 @@ KABC::Secrecy SecrecyWidget::secrecy() const return secrecy; } -#ifndef KAB_EMBEDDED -#include "secrecywidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_secrecywidget.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/undo.cpp b/kaddressbook/undo.cpp index 4442087..a6c1580 100644 --- a/kaddressbook/undo.cpp +++ b/kaddressbook/undo.cpp @@ -113,7 +113,7 @@ void RedoStack::redo() command->redo(); UndoStack::instance()->push( command ); } -#ifndef KAB_EMBEDDED -#include "undo.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_undo.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/undo.h b/kaddressbook/undo.h index 843bc26..a8ba2ee 100644 --- a/kaddressbook/undo.h +++ b/kaddressbook/undo.h @@ -24,9 +24,9 @@ #ifndef UNDO_H #define UNDO_H #include <qobject.h> -#include <qptrstack.h> +#include <q3ptrstack.h> #include <qstring.h> class Command { @@ -66,9 +66,9 @@ class StackBase : public QObject * use the stack, however the subclasses need it to modify the stack. */ Command *pop(); - QPtrStack<Command> mCommandStack; + Q3PtrStack<Command> mCommandStack; }; class UndoStack : public StackBase { diff --git a/kaddressbook/undocmds.cpp b/kaddressbook/undocmds.cpp index 5807dc0..e900b00 100644 --- a/kaddressbook/undocmds.cpp +++ b/kaddressbook/undocmds.cpp @@ -20,9 +20,9 @@ with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ -#include <qtextstream.h> +#include <q3textstream.h> #include <qapplication.h> #include <qclipboard.h> diff --git a/kaddressbook/viewconfigurefieldspage.cpp b/kaddressbook/viewconfigurefieldspage.cpp index 5daae1a..7366a0b 100644 --- a/kaddressbook/viewconfigurefieldspage.cpp +++ b/kaddressbook/viewconfigurefieldspage.cpp @@ -35,22 +35,26 @@ #include <klocale.h> #include <qtoolbutton.h> #include <qapplication.h> +#include <QDesktopWidget> #include <qlabel.h> -#include <qlistbox.h> +#include <q3listbox.h> #include <qlayout.h> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3BoxLayout> #include "viewconfigurefieldspage.h" -class FieldItem : public QListBoxText +class FieldItem : public Q3ListBoxText { public: - FieldItem( QListBox *parent, KABC::Field *field ) - : QListBoxText( parent, field->label() ), mField( field ) {} + FieldItem( Q3ListBox *parent, KABC::Field *field ) + : Q3ListBoxText( parent, field->label() ), mField( field ) {} - FieldItem( QListBox *parent, KABC::Field *field, int index ) - : QListBoxText( parent, field->label(), parent->item( index ) ), + FieldItem( Q3ListBox *parent, KABC::Field *field, int index ) + : Q3ListBoxText( parent, field->label(), parent->item( index ) ), mField( field ) {} KABC::Field *field() { return mField; } @@ -105,9 +109,9 @@ void ViewConfigureFieldsPage::slotShowFields( int index ) KABC::Field::List allFields = mAddressBook->fields( category ); KABC::Field::List::ConstIterator it; for ( it = allFields.begin(); it != allFields.end(); ++it ) { - QListBoxItem *item = mSelectedBox->firstItem(); + Q3ListBoxItem *item = mSelectedBox->firstItem(); while( item ) { FieldItem *fieldItem = static_cast<FieldItem *>( item ); if ( (*it)->equals( fieldItem->field() ) ) break; @@ -188,9 +192,9 @@ void ViewConfigureFieldsPage::slotButtonsEnabled() void ViewConfigureFieldsPage::slotMoveUp() { int i = mSelectedBox->currentItem(); if ( i > 0 ) { - QListBoxItem *item = mSelectedBox->item( i ); + Q3ListBoxItem *item = mSelectedBox->item( i ); mSelectedBox->takeItem( item ); mSelectedBox->insertItem( item, i - 1 ); mSelectedBox->setCurrentItem( item ); mSelectedBox->setSelected( i - 1, true ); @@ -200,9 +204,9 @@ void ViewConfigureFieldsPage::slotMoveUp() void ViewConfigureFieldsPage::slotMoveDown() { int i = mSelectedBox->currentItem(); if ( i > -1 && i < (int)mSelectedBox->count() - 1 ) { - QListBoxItem *item = mSelectedBox->item( i ); + Q3ListBoxItem *item = mSelectedBox->item( i ); mSelectedBox->takeItem( item ); mSelectedBox->insertItem( item, i + 1 ); mSelectedBox->setCurrentItem( item ); mSelectedBox->setSelected( i + 1, true ); @@ -218,13 +222,13 @@ void ViewConfigureFieldsPage::initGUI() setCaption( i18n("Select Fields to Display") ); - QGridLayout *gl = 0; + Q3GridLayout *gl = 0; if (orientation == 0) - gl = new QGridLayout( this , 6, 4, 0, KDialog::spacingHint() ); + gl = new Q3GridLayout( this , 6, 4, 0, KDialog::spacingHint() ); else - gl = new QGridLayout( this , 4, 6, 0, KDialog::spacingHint() ); + gl = new Q3GridLayout( this , 4, 6, 0, KDialog::spacingHint() ); #ifndef KAB_EMBEDDED mCategoryCombo = new KComboBox( false, this ); #else //KAB_EMBEDDED @@ -248,34 +252,34 @@ void ViewConfigureFieldsPage::initGUI() else gl->addWidget( label, 2, 0 ); - mUnSelectedBox = new QListBox( this ); - mUnSelectedBox->setSelectionMode( QListBox::Extended ); + mUnSelectedBox = new Q3ListBox( this ); + mUnSelectedBox->setSelectionMode( Q3ListBox::Extended ); mUnSelectedBox->setMinimumHeight( 80 ); if (orientation == 0) gl->addWidget( mUnSelectedBox, 1, 0 ); else gl->addWidget( mUnSelectedBox, 0, 1 ); - mSelectedBox = new QListBox( this ); + mSelectedBox = new Q3ListBox( this ); //if ( QApplication::desktop()->width() < 320 ) { // mUnSelectedBox->setMaximumWidth( 134 ); // mSelectedBox->setMaximumWidth( 134 ); //} - mSelectedBox->setSelectionMode( QListBox::Extended ); + mSelectedBox->setSelectionMode( Q3ListBox::Extended ); mSelectedBox->setMinimumHeight( 80 ); label->setBuddy( mSelectedBox ); if (orientation == 0) gl->addWidget( mSelectedBox, 1, 2 ); else gl->addWidget( mSelectedBox, 2, 1 ); - QBoxLayout *vb1 = 0; + Q3BoxLayout *vb1 = 0; if (orientation == 0) - vb1 = new QBoxLayout( QBoxLayout::TopToBottom, KDialog::spacingHint() ); + vb1 = new Q3BoxLayout( Q3BoxLayout::TopToBottom, KDialog::spacingHint() ); else - vb1 = new QBoxLayout( QBoxLayout::LeftToRight, KDialog::spacingHint() ); + vb1 = new Q3BoxLayout( Q3BoxLayout::LeftToRight, KDialog::spacingHint() ); vb1->addStretch(); mAddButton = new QToolButton( this ); @@ -300,13 +304,13 @@ void ViewConfigureFieldsPage::initGUI() gl->addLayout( vb1, 1, 1 ); else gl->addLayout( vb1, 1, 1 ); - QBoxLayout *vb2 = 0; + Q3BoxLayout *vb2 = 0; if (orientation == 0) - vb2 = new QBoxLayout( QBoxLayout::TopToBottom, KDialog::spacingHint() ); + vb2 = new Q3BoxLayout( Q3BoxLayout::TopToBottom, KDialog::spacingHint() ); else - vb2 = new QBoxLayout( QBoxLayout::LeftToRight, KDialog::spacingHint() ); + vb2 = new Q3BoxLayout( Q3BoxLayout::LeftToRight, KDialog::spacingHint() ); vb2->addStretch(); mUpButton = new QToolButton( this ); @@ -339,13 +343,13 @@ void ViewConfigureFieldsPage::initGUI() gl->activate(); connect( mUnSelectedBox, SIGNAL( selectionChanged() ), SLOT( slotButtonsEnabled() ) ); connect( mSelectedBox, SIGNAL( selectionChanged() ), SLOT( slotButtonsEnabled() ) ); - connect( mSelectedBox, SIGNAL( currentChanged( QListBoxItem * ) ), SLOT( slotButtonsEnabled() ) ); + connect( mSelectedBox, SIGNAL( currentChanged( Q3ListBoxItem * ) ), SLOT( slotButtonsEnabled() ) ); slotButtonsEnabled(); } -#ifndef KAB_EMBEDDED -#include "viewconfigurefieldspage.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_viewconfigurefieldspage.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/viewconfigurefieldspage.h b/kaddressbook/viewconfigurefieldspage.h index b27668c..42d132f 100644 --- a/kaddressbook/viewconfigurefieldspage.h +++ b/kaddressbook/viewconfigurefieldspage.h @@ -34,10 +34,10 @@ class KComboBox; #else //KAB_EMBEDDED class QComboBox; #endif //KAB_EMBEDDED -class QListBox; -class QListBoxItem; +class Q3ListBox; +class Q3ListBoxItem; class QPushButton; class QToolButton; class ViewConfigureFieldsPage : public QWidget @@ -67,10 +67,10 @@ class ViewConfigureFieldsPage : public QWidget KComboBox *mCategoryCombo; #else //KAB_EMBEDDED QComboBox *mCategoryCombo; #endif //KAB_EMBEDDED - QListBox *mSelectedBox; - QListBox *mUnSelectedBox; + Q3ListBox *mSelectedBox; + Q3ListBox *mUnSelectedBox; QToolButton *mAddButton; QToolButton *mRemoveButton; QToolButton *mUpButton; QToolButton *mDownButton; diff --git a/kaddressbook/viewconfigurefilterpage.cpp b/kaddressbook/viewconfigurefilterpage.cpp index b085a5e..cdb778b 100644 --- a/kaddressbook/viewconfigurefilterpage.cpp +++ b/kaddressbook/viewconfigurefilterpage.cpp @@ -26,12 +26,15 @@ #else //KAB_EMBEDDED #include <qcombobox.h> #endif //KAB_EMBEDDED -#include <qbuttongroup.h> +#include <q3buttongroup.h> #include <qlabel.h> #include <qlayout.h> #include <qradiobutton.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3VBoxLayout> #include <kconfig.h> #include <kdialog.h> #include <klocale.h> @@ -43,11 +46,11 @@ ViewConfigureFilterPage::ViewConfigureFilterPage( QWidget *parent, const char *name ) : QWidget( parent, name ) { - QBoxLayout *topLayout = new QVBoxLayout( this, 0, KDialog::spacingHint() ); + Q3BoxLayout *topLayout = new Q3VBoxLayout( this, 0, KDialog::spacingHint() ); - mFilterGroup = new QButtonGroup(); + mFilterGroup = new Q3ButtonGroup(); connect( mFilterGroup, SIGNAL( clicked( int ) ), SLOT( buttonClicked( int ) ) ); QLabel *label = new QLabel( i18n( "The default filter will be activated whenever" " this view is displayed. This feature allows you to configure views that only" @@ -67,9 +70,9 @@ ViewConfigureFilterPage::ViewConfigureFilterPage( QWidget *parent, button = new QRadioButton( i18n( "Use last active filter" ), this ); mFilterGroup->insert( button ); topLayout->addWidget( button ); - QBoxLayout *comboLayout = new QHBoxLayout(); + Q3BoxLayout *comboLayout = new Q3HBoxLayout(); topLayout->addLayout( comboLayout ); button = new QRadioButton( i18n( "Use filter:" ), this ); mFilterGroup->insert( button ); comboLayout->addWidget( button ); @@ -131,7 +134,7 @@ void ViewConfigureFilterPage::buttonClicked( int id ) { mFilterCombo->setEnabled( id == 2 ); } -#ifndef KAB_EMBEDDED -#include "viewconfigurefilterpage.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_viewconfigurefilterpage.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/viewconfigurefilterpage.h b/kaddressbook/viewconfigurefilterpage.h index 3be9564..fb39a61 100644 --- a/kaddressbook/viewconfigurefilterpage.h +++ b/kaddressbook/viewconfigurefilterpage.h @@ -25,9 +25,9 @@ #define VIEWCONFIGUREFILTERPAGE #include <qwidget.h> -class QButtonGroup; +class Q3ButtonGroup; #ifndef KAB_EMBEDDED class KComboBox; #else //KAB_EMBEDDED @@ -56,8 +56,8 @@ class ViewConfigureFilterPage : public QWidget #else //KAB_EMBEDDED QComboBox *mFilterCombo; #endif //KAB_EMBEDDED - QButtonGroup *mFilterGroup; + Q3ButtonGroup *mFilterGroup; }; #endif diff --git a/kaddressbook/viewconfigurewidget.cpp b/kaddressbook/viewconfigurewidget.cpp index 666e188..047df8c 100644 --- a/kaddressbook/viewconfigurewidget.cpp +++ b/kaddressbook/viewconfigurewidget.cpp @@ -23,9 +23,9 @@ #ifndef KAB_EMBEDDED -#include <qvbox.h> +#include <q3vbox.h> #include <kapplication.h> #include <kconfig.h> #include <kdebug.h> @@ -36,8 +36,11 @@ #endif //KAB_EMBEDDED #include <qlayout.h> +//Added by qt3to4: +#include <Q3VBoxLayout> +#include <QPixmap> #include <kjanuswidget.h> #include <kglobal.h> #include <klocale.h> @@ -49,16 +52,16 @@ ViewConfigureWidget::ViewConfigureWidget( KABC::AddressBook *ab, QWidget *parent, const char *name ) : ConfigureWidget( ab, parent, name ) { - QVBoxLayout *topLayout = new QVBoxLayout( this ); + Q3VBoxLayout *topLayout = new Q3VBoxLayout( this ); mMainWidget = new KJanusWidget( this, "JanusWidget", KJanusWidget::Tabbed ); topLayout->addWidget( mMainWidget ); // Add the first page, the attributes - QVBox *page = addPage( i18n( "Fields" ), QString::null, + Q3VBox *page = addPage( i18n( "Fields" ), QString::null, KGlobal::iconLoader()->loadIcon( "view_detailed", KIcon::Panel, 16 ) ); @@ -92,15 +95,15 @@ void ViewConfigureWidget::saveSettings( KConfig *config ) mFieldsPage->saveSettings( config ); mFilterPage->saveSettings( config ); } -QVBox *ViewConfigureWidget::addPage( const QString &item, const QString &header, +Q3VBox *ViewConfigureWidget::addPage( const QString &item, const QString &header, const QPixmap &pixmap ) { return mMainWidget->addVBoxPage( item, header, pixmap ); } -#include <qframe.h> +#include <q3frame.h> #include <qlabel.h> #include <qlayout.h> #include <stdlib.h> @@ -151,9 +154,7 @@ void ViewConfigureDialog::slotHelp() qDebug("ViewConfigureDialog::slotHelp not yet implemented"); #endif //KAB_EMBEDDED } -#ifndef KAB_EMBEDDED -#include "viewconfigurewidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_viewconfigurewidget.cpp" #endif //KAB_EMBEDDED - - diff --git a/kaddressbook/viewconfigurewidget.h b/kaddressbook/viewconfigurewidget.h index 0c2b77c..e3b9b12 100644 --- a/kaddressbook/viewconfigurewidget.h +++ b/kaddressbook/viewconfigurewidget.h @@ -27,9 +27,9 @@ #include "configurewidget.h" -class QVBox; +class Q3VBox; #include <kdialogbase.h> #include <qpixmap.h> @@ -73,9 +73,9 @@ class ViewConfigureWidget : public ConfigureWidget /** Use this method to add new pages to the widget. */ - QVBox *addPage( const QString &item, const QString &header = QString::null, + Q3VBox *addPage( const QString &item, const QString &header = QString::null, const QPixmap &pixmap = QPixmap() ); private: KJanusWidget *mMainWidget; diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp index b5d9419..5cfe3ad 100644 --- a/kaddressbook/viewmanager.cpp +++ b/kaddressbook/viewmanager.cpp @@ -49,9 +49,12 @@ $Id$ #include "kaddressbookview.h" #include <qaction.h> #include <qmessagebox.h> -#include <qpopupmenu.h> +#include <q3popupmenu.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <QDropEvent> #include <kconfigbase.h> #endif //KAB_EMBEDDED @@ -60,9 +63,10 @@ $Id$ #include <kactionclasses.h> #include <qlayout.h> #include <qapplication.h> -#include <qwidgetstack.h> +#include <QDesktopWidget> +#include <q3widgetstack.h> #include <kabc/addressbook.h> #include "filtereditdialog.h" #include "addviewdialog.h" @@ -116,9 +120,9 @@ void ViewManager::restoreSettings() // Tell the views to reread their config, since they may have // been modified by global settings QString _oldgroup = mCore->config()->group(); - QDictIterator<KAddressBookView> it( mViewDict ); + Q3DictIterator<KAddressBookView> it( mViewDict ); for ( it.toFirst(); it.current(); ++it ) { KConfigGroupSaver saver( mCore->config(), it.currentKey() ); it.current()->readConfig( mCore->config() ); } @@ -130,9 +134,9 @@ void ViewManager::restoreSettings() void ViewManager::saveSettings() { QString _oldgroup = mCore->config()->group(); - QDictIterator<KAddressBookView> it( mViewDict ); + Q3DictIterator<KAddressBookView> it( mViewDict ); for ( it.toFirst(); it.current(); ++it ) { KConfigGroupSaver saver( mCore->config(), it.currentKey() ); #ifdef DESKTOP_VERSION (*it)->writeConfig( mCore->config() ); @@ -160,9 +164,9 @@ QStringList ViewManager::selectedUids() const QStringList ViewManager::selectedEmails() const { if ( mActiveView ) - return mActiveView->selectedEmails(); + return QStringList(mActiveView->selectedEmails()); else return QStringList(); } @@ -555,9 +559,9 @@ void ViewManager::startDrag() for ( iter = uidList.begin(); iter != uidList.end(); ++iter ) addrList.append( mCore->addressBook()->findByUid( *iter ) ); KMultipleDrag *drag = new KMultipleDrag( this ); - drag->addDragObject( new QTextDrag( AddresseeUtil::addresseesToClipboard(addrList), this ) ); + drag->addDragObject( new Q3TextDrag( AddresseeUtil::addresseesToClipboard(addrList), this ) ); KABC::Addressee::List::Iterator it; QStringList vcards; for ( it = addrList.begin(); it != addrList.end(); ++it ) { QString vcard = QString::null; @@ -658,11 +662,11 @@ void ViewManager::initActions() //US <ActionList name="view_loadedviews"/> //US <Separator/> #ifdef KAB_EMBEDDED - QPopupMenu *viewmenu = (QPopupMenu*)mCore->getViewMenu(); - QPopupMenu *settingsmenu = (QPopupMenu*)mCore->getSettingsMenu(); - QPopupMenu *filtermenu = (QPopupMenu*)mCore->getFilterMenu(); + Q3PopupMenu *viewmenu = (Q3PopupMenu*)mCore->getViewMenu(); + Q3PopupMenu *settingsmenu = (Q3PopupMenu*)mCore->getSettingsMenu(); + Q3PopupMenu *filtermenu = (Q3PopupMenu*)mCore->getFilterMenu(); #endif //KAB_EMBEDDED mActionSelectView = new KSelectAction( i18n( "Select View" ), 0, mCore->actionCollection(), "select_view" ); #if KDE_VERSION >= 309 @@ -737,12 +741,12 @@ void ViewManager::initActions() } void ViewManager::initGUI() { - QHBoxLayout *layout = new QHBoxLayout( this, 0, 0 ); - mViewWidgetStack = new QWidgetStack( this ); + Q3HBoxLayout *layout = new Q3HBoxLayout( this, 0, 0 ); + mViewWidgetStack = new Q3WidgetStack( this ); layout->addWidget( mViewWidgetStack ); } -#ifndef KAB_EMBEDDED -#include "viewmanager.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_viewmanager.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/viewmanager.h b/kaddressbook/viewmanager.h index ab5d372..4bbdbc7 100644 --- a/kaddressbook/viewmanager.h +++ b/kaddressbook/viewmanager.h @@ -25,17 +25,19 @@ #define VIEWMANAGER_H #include <qwidget.h> #include <qstringlist.h> +//Added by qt3to4: +#include <QDropEvent> #include <kaddressbookview.h> -#include <qdict.h> +#include <q3dict.h> #include "filter.h" class KAction; class KSelectAction; class KABCore; -class QWidgetStack; +class Q3WidgetStack; class QDropEvent; namespace KABC { class AddressBook; } @@ -144,13 +146,13 @@ class ViewManager : public QWidget Filter mCurrentFilter; Filter::List mFilterList; - QDict<KAddressBookView> mViewDict; - QDict<ViewFactory> mViewFactoryDict; + Q3Dict<KAddressBookView> mViewDict; + Q3Dict<ViewFactory> mViewFactoryDict; QStringList mViewNameList; - QWidgetStack *mViewWidgetStack; + Q3WidgetStack *mViewWidgetStack; KAddressBookView *mActiveView; KAction *mActionDeleteView; KSelectAction *mActionSelectFilter; diff --git a/kaddressbook/views/cardview.cpp b/kaddressbook/views/cardview.cpp index b6e053f..1a29f41 100644 --- a/kaddressbook/views/cardview.cpp +++ b/kaddressbook/views/cardview.cpp @@ -33,8 +33,16 @@ #include <qstyle.h> #include <qcursor.h> #include <qtooltip.h> #include <qapplication.h> +//Added by qt3to4: +#include <QKeyEvent> +#include <Q3PtrList> +#include <QResizeEvent> +#include <QFocusEvent> +#include <QMouseEvent> +#include <QEvent> +#include <QWheelEvent> #include "kabprefs.h" #include <kdebug.h> #include <kglobalsettings.h> @@ -70,13 +78,13 @@ class CardViewTip : public QLabel { // // Warning: make sure you use findRef() instead of find() to find an // item! Only the pointer value is unique in the list. // -class CardViewItemList : public QPtrList<CardViewItem> +class CardViewItemList : public Q3PtrList<CardViewItem> { protected: - virtual int compareItems(QPtrCollection::Item item1, - QPtrCollection::Item item2) + virtual int compareItems(Q3PtrCollection::Item item1, + Q3PtrCollection::Item item2) { CardViewItem *cItem1 = (CardViewItem*)item1; CardViewItem *cItem2 = (CardViewItem*)item2; @@ -160,9 +168,9 @@ class CardViewPrivate mCompText( QString::null ) {}; CardViewItemList mItemList; - QPtrList<CardViewSeparator> mSeparatorList; + Q3PtrList<CardViewSeparator> mSeparatorList; QFontMetrics *mFm; QFontMetrics *mBFm; // bold font QFont mHeaderFont; // custom header font CardView::SelectionMode mSelectionMode; @@ -207,9 +215,9 @@ class CardViewItemPrivate y( 0 ){}; QString mCaption; - QPtrList< CardViewItem::Field > mFieldList; + Q3PtrList< CardViewItem::Field > mFieldList; bool mSelected; int x; // horizontal position, set by the view int y; // vertical position, set by the view int maxLabelWidth; // the width of the widest label, according to the view font. @@ -312,9 +320,9 @@ void CardViewItem::paintCard(QPainter *p, QColorGroup &cg) p->drawText(2+mg, 2+mg + bFm.ascent()/*bFm.height()*//*-bFm.descent()*//*-bFm.leading()*/, trimString(d->mCaption, w-4, bFm)); p->restore(); // Go through the fields and draw them - QPtrListIterator< CardViewItem::Field > iter(d->mFieldList); + Q3PtrListIterator< CardViewItem::Field > iter(d->mFieldList); QString label, value; int yPos = mg + 4 + bFm.height()/* + 1*/ + fm.height(); // why the + 1 ??? (anders) p->setPen(cg.text()); @@ -407,14 +415,14 @@ int CardViewItem::height( bool allowCache ) const //int sp = QMAX( 0, 2- mView->d->mFm->leading() ); // field spacing NOTE make a property int fieldHeight = 0; int lines; int maxLines( mView->maxFieldLines() ); - QPtrListIterator< CardViewItem::Field > iter(d->mFieldList); + Q3PtrListIterator< CardViewItem::Field > iter(d->mFieldList); for (iter.toFirst(); iter.current(); ++iter) { if ( !sef && (*iter)->second.isEmpty() ) continue; - lines = QMIN( (*iter)->second.contains('\n') + 1, maxLines ); + lines = QMIN( (*iter)->second.count('\n') + 1, maxLines ); fieldHeight += ( lines * fh ) + 2;//sp; } // height of caption font (bold) @@ -449,9 +457,9 @@ void CardViewItem::insertField(const QString &label, const QString &value) void CardViewItem::removeField(const QString &label) { CardViewItem::Field *f; - QPtrListIterator< CardViewItem::Field > iter(d->mFieldList); + Q3PtrListIterator< CardViewItem::Field > iter(d->mFieldList); for (iter.toFirst(); iter.current(); ++iter) { f = *iter; if (f->first == label) @@ -522,9 +530,9 @@ void CardViewItem::setCaption(const QString &caption) } QString CardViewItem::fieldValue(const QString &label) { - QPtrListIterator< CardViewItem::Field > iter(d->mFieldList); + Q3PtrListIterator< CardViewItem::Field > iter(d->mFieldList); for (iter.toFirst(); iter.current(); ++iter) if ((*iter)->first == label) return (*iter)->second; @@ -568,9 +576,9 @@ void CardViewItem::showFullString( const QPoint &itempos, CardViewTip *tip ) // { Field *_f; for (_f = d->mFieldList.first(); _f != f; _f = d->mFieldList.next()) if ( se || ! _f->second.isEmpty() ) - y += ( QMIN(_f->second.contains('\n')+1, maxLines) * fh ) + 2; + y += ( QMIN(_f->second.count('\n')+1, maxLines) * fh ) + 2; // } if ( isLabel && itempos.y() > y + fh ) return; // label or data? @@ -585,9 +593,9 @@ void CardViewItem::showFullString( const QPoint &itempos, CardViewTip *tip ) { trimmed = mView->d->mFm->width( s ) > mw - colonWidth; } else { QRect r( mView->d->mFm->boundingRect( 0, 0, INT_MAX, INT_MAX, Qt::AlignTop|Qt::AlignLeft, s ) ); - trimmed = r.width() > mw || r.height()/fh > QMIN(s.contains('\n') + 1, maxLines); + trimmed = r.width() > mw || r.height()/fh > QMIN(s.count('\n') + 1, maxLines); } } if ( trimmed ) { @@ -625,9 +633,9 @@ CardViewItem::Field *CardViewItem::fieldAt( const QPoint & itempos ) const Field *f; for ( f = d->mFieldList.first(); f; f = d->mFieldList.next() ) { if ( showEmpty || !f->second.isEmpty() ) - ypos += ( QMIN( f->second.contains('\n')+1, maxLines ) *fh)+2; + ypos += ( QMIN( f->second.count('\n')+1, maxLines ) *fh)+2; if ( iy <= ypos ) break; } return f ? f : 0; @@ -636,9 +644,9 @@ CardViewItem::Field *CardViewItem::fieldAt( const QPoint & itempos ) const //BEGIN CardView CardView::CardView(QWidget *parent, const char *name) - : QScrollView(parent, name), + : Q3ScrollView(parent, name), d(new CardViewPrivate()) { mFlagKeyPressed = false; mFlagBlockKeyPressed = false; @@ -655,15 +663,15 @@ CardView::CardView(QWidget *parent, const char *name) d->mTimer = ( new QTimer(this, "mouseTimer") ), viewport()->setMouseTracking( true ); viewport()->setFocusProxy(this); - viewport()->setFocusPolicy(WheelFocus); - viewport()->setBackgroundMode(PaletteBase); + viewport()->setFocusPolicy(Qt::WheelFocus); + viewport()->setBackgroundMode(Qt::PaletteBase); connect( d->mTimer, SIGNAL(timeout()), this, SLOT(tryShowFullText()) ); //US setBackgroundMode(PaletteBackground, PaletteBase); - setBackgroundMode(PaletteBackground); + setBackgroundMode(Qt::PaletteBackground); // no reason for a vertical scrollbar setVScrollBarMode(AlwaysOff); } @@ -738,9 +746,9 @@ void CardView::setCurrentItem( CardViewItem *item ) CardViewItem *CardView::itemAt(const QPoint &viewPos) { CardViewItem *item = 0; - QPtrListIterator<CardViewItem> iter(d->mItemList); + Q3PtrListIterator<CardViewItem> iter(d->mItemList); bool found = false; for (iter.toFirst(); iter.current() && !found; ++iter) { item = *iter; @@ -786,9 +794,9 @@ CardView::SelectionMode CardView::selectionMode() const } void CardView::selectAll(bool state) { - QPtrListIterator<CardViewItem> iter(d->mItemList); + Q3PtrListIterator<CardViewItem> iter(d->mItemList); if (!state) { for (iter.toFirst(); iter.current(); ++iter) { @@ -877,9 +885,9 @@ bool CardView::isSelected(CardViewItem *item) const CardViewItem *CardView::selectedItem() const { // find the first selected item - QPtrListIterator<CardViewItem> iter(d->mItemList); + Q3PtrListIterator<CardViewItem> iter(d->mItemList); for (iter.toFirst(); iter.current(); ++iter) { if ((*iter)->isSelected()) return *iter; @@ -954,9 +962,9 @@ void CardView::drawContents(QPainter *p, int clipx, int clipy, // make sure the viewport is a pure background viewport()->erase( QRect ( cX, cY , clipw, cliph ) ); // Now tell the cards to draw, if they are in the clip region - QPtrListIterator<CardViewItem> iter(d->mItemList); + Q3PtrListIterator<CardViewItem> iter(d->mItemList); for (iter.toFirst(); iter.current(); ++iter) { item = *iter; cardRect.setRect( item->d->x, item->d->y, d->mItemWidth, item->height() ); @@ -974,9 +982,9 @@ void CardView::drawContents(QPainter *p, int clipx, int clipy, } } // Followed by the separators if they are in the clip region - QPtrListIterator<CardViewSeparator> sepIter(d->mSeparatorList); + Q3PtrListIterator<CardViewSeparator> sepIter(d->mSeparatorList); for (sepIter.toFirst(); sepIter.current(); ++sepIter) { sep = *sepIter; sepRect = sep->mRect; @@ -992,9 +1000,9 @@ void CardView::drawContents(QPainter *p, int clipx, int clipy, } void CardView::resizeEvent(QResizeEvent *e) { - QScrollView::resizeEvent(e); + Q3ScrollView::resizeEvent(e); setLayoutDirty(true); } @@ -1012,9 +1020,9 @@ void CardView::calcLayout() // delete the old separators d->mSeparatorList.clear(); - QPtrListIterator<CardViewItem> iter(d->mItemList); + Q3PtrListIterator<CardViewItem> iter(d->mItemList); CardViewItem *item = 0; CardViewSeparator *sep = 0; xPos += cardSpacing; @@ -1055,9 +1063,9 @@ void CardView::calcLayout() resizeContents( xPos + cardSpacing, maxHeight ); // Update the height of all the separators now that we know the // max height of a column - QPtrListIterator<CardViewSeparator> sepIter(d->mSeparatorList); + Q3PtrListIterator<CardViewSeparator> sepIter(d->mSeparatorList); for (sepIter.toFirst(); sepIter.current(); ++sepIter) { (*sepIter)->mRect.setHeight(maxHeight - 2*cardSpacing - 2*d->mItemMargin); } @@ -1100,9 +1108,9 @@ void CardView::setItemSpacing( uint spacing ) } void CardView::contentsMousePressEvent(QMouseEvent *e) { - QScrollView::contentsMousePressEvent(e); + Q3ScrollView::contentsMousePressEvent(e); QPoint pos = e->pos(); d->mLastClickPos = pos; @@ -1170,9 +1178,9 @@ void CardView::contentsMousePressEvent(QMouseEvent *e) if ( item == other ) return; bool s = ! item->isSelected(); - if ( s && ! (e->state() & ControlButton) ) + if ( s && ! (e->state() & Qt::ControlButton) ) { bool b = signalsBlocked(); blockSignals(true); selectAll(false); @@ -1218,9 +1226,9 @@ void CardView::contentsMousePressEvent(QMouseEvent *e) } void CardView::contentsMouseReleaseEvent(QMouseEvent *e) { - QScrollView::contentsMouseReleaseEvent(e); + Q3ScrollView::contentsMouseReleaseEvent(e); if ( d->mResizeAnchor ) { // finish the resizing: @@ -1256,9 +1264,9 @@ void CardView::contentsMouseReleaseEvent(QMouseEvent *e) } void CardView::contentsMouseDoubleClickEvent(QMouseEvent *e) { - QScrollView::contentsMouseDoubleClickEvent(e); + Q3ScrollView::contentsMouseDoubleClickEvent(e); CardViewItem *item = itemAt(e->pos()); if (item) @@ -1301,14 +1309,14 @@ void CardView::contentsMouseMoveEvent( QMouseEvent *e ) int colw = colcontentw + d->mSepWidth; int m = e->x()%colw; if ( m >= colcontentw && m > 0 ) { - setCursor( SplitVCursor ); // Why does this fail sometimes? + setCursor( Qt::SplitVCursor ); // Why does this fail sometimes? d->mOnSeparator = true; } else { - setCursor( ArrowCursor ); + setCursor( Qt::ArrowCursor ); d->mOnSeparator = false; } } } @@ -1323,9 +1331,9 @@ void CardView::leaveEvent( QEvent * ) d->mTimer->stop(); if (d->mOnSeparator) { d->mOnSeparator = false; - setCursor( ArrowCursor ); + setCursor( Qt::ArrowCursor ); } } void CardView::focusInEvent( QFocusEvent * ) @@ -1367,23 +1375,23 @@ void CardView::keyPressEvent( QKeyEvent *e ) CardViewItem *old = d->mCurrentItem; switch ( e->key() ) { - case Key_Up: + case Qt::Key_Up: if ( pos > 0 ) { aItem = d->mItemList.at( pos - 1 ); setCurrentItem( aItem ); } break; - case Key_Down: + case Qt::Key_Down: if ( pos < d->mItemList.count() - 1 ) { aItem = d->mItemList.at( pos + 1 ); setCurrentItem( aItem ); } break; - case Key_Left: + case Qt::Key_Left: { // look for an item in the previous/next column, starting from // the vertical middle of the current item. // FIXME use nice calculatd measures!!! @@ -1399,9 +1407,9 @@ void CardView::keyPressEvent( QKeyEvent *e ) if ( aItem ) setCurrentItem( aItem ); } break; - case Key_Right: + case Qt::Key_Right: { // FIXME use nice calculated measures!!! QPoint aPoint( d->mCurrentItem->d->x + d->mItemWidth, d->mCurrentItem->d->y ); aPoint += QPoint( 30,(d->mCurrentItem->height()/2) ); @@ -1414,17 +1422,17 @@ void CardView::keyPressEvent( QKeyEvent *e ) if ( aItem ) setCurrentItem( aItem ); } break; - case Key_Home: + case Qt::Key_Home: aItem = d->mItemList.first(); setCurrentItem( aItem ); break; - case Key_End: + case Qt::Key_End: aItem = d->mItemList.last(); setCurrentItem( aItem ); break; - case Key_Prior: // PageUp + case Qt::Key_Prior: // PageUp { // QListView: "Make the item above the top visible and current" // TODO if contentsY(), pick the top item of the leftmost visible column if ( contentsX() <= 0 ) @@ -1435,9 +1443,9 @@ void CardView::keyPressEvent( QKeyEvent *e ) if ( aItem ) setCurrentItem( aItem ); } break; - case Key_Next: // PageDown + case Qt::Key_Next: // PageDown { // QListView: "Make the item below the bottom visible and current" // find the first not fully visible column. // TODO: consider if a partly visible (or even hidden) item at the @@ -1457,21 +1465,21 @@ void CardView::keyPressEvent( QKeyEvent *e ) if ( aItem ) setCurrentItem( aItem ); } break; - case Key_Space: + case Qt::Key_Space: setSelected( d->mCurrentItem, !d->mCurrentItem->isSelected() ); emit selectionChanged(); break; - case Key_Return: - case Key_Enter: + case Qt::Key_Return: + case Qt::Key_Enter: { emit returnPressed( d->mCurrentItem ); emit executed( d->mCurrentItem ); } break; default: - if ( (e->state() & ControlButton) && e->key() == Key_A ) + if ( (e->state() & Qt::ControlButton) && e->key() == Qt::Key_A ) { // select all selectAll( true ); break; @@ -1487,9 +1495,9 @@ void CardView::keyPressEvent( QKeyEvent *e ) if ( aItem ) { if ( d->mSelectionMode == CardView::Extended ) { - if ( (e->state() & ShiftButton) ) + if ( (e->state() & Qt::ShiftButton) ) { // shift button: toggle range // if control button is pressed, leave all items // and toggle selection current->old current @@ -1518,9 +1526,9 @@ void CardView::keyPressEvent( QKeyEvent *e ) repaintItem( item ); } emit selectionChanged(); } - else if ( (e->state() & ControlButton) ) + else if ( (e->state() & Qt::ControlButton) ) { // control button: do nothing } else @@ -1637,11 +1645,11 @@ void CardView::drawRubberBands( int pos ) int x = d->firstX + tmpcw - d->mSepWidth - contentsX(); int h = visibleHeight(); QPainter p( viewport() ); - p.setRasterOp( XorROP ); - p.setPen( gray ); - p.setBrush( gray ); + p.setCompositionMode( QPainter::CompositionMode_Xor ); + p.setPen( Qt::gray ); + p.setBrush( Qt::gray ); uint n = d->first; // erase if ( d->mRubberBandAnchor ) do { @@ -1698,9 +1706,9 @@ QFont CardView::headerFont() const } void CardView::setFont( const QFont &fnt ) { - QScrollView::setFont( fnt ); + Q3ScrollView::setFont( fnt ); delete d->mFm; d->mFm = new QFontMetrics( fnt ); } @@ -1735,16 +1743,16 @@ void CardView::keyReleaseEvent ( QKeyEvent * e ) qApp->processEvents(); mFlagBlockKeyPressed = false; mFlagKeyPressed = false; } - QScrollView::keyReleaseEvent ( e ); + Q3ScrollView::keyReleaseEvent ( e ); } //END Cardview -#ifndef KAB_EMBEDDED -#include "cardview.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_cardview.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/views/cardview.h b/kaddressbook/views/cardview.h index 2ea3771..9c245ea 100644 --- a/kaddressbook/views/cardview.h +++ b/kaddressbook/views/cardview.h @@ -1,13 +1,21 @@ #ifndef CARDVIEW_H #define CARDVIEW_H -#include <qscrollview.h> -#include <qptrlist.h> +#include <q3scrollview.h> +#include <q3ptrlist.h> #include <qstring.h> #include <qrect.h> #include <qpair.h> #include <qpoint.h> +//Added by qt3to4: +#include <QWheelEvent> +#include <QResizeEvent> +#include <QFocusEvent> +#include <QLabel> +#include <QMouseEvent> +#include <QKeyEvent> +#include <QEvent> class QLabel; class QPainter; class QResizeEvent; @@ -147,9 +155,9 @@ class CardViewItem * QIconView. The CardView is also completely independant of KAddressBook and * can be used elsewhere. With the exception of a few simple config checks, * the CardView is also 100% independant of KDE. */ -class CardView : public QScrollView +class CardView : public Q3ScrollView { friend class CardViewItem; Q_OBJECT diff --git a/kaddressbook/views/colorlistbox.cpp b/kaddressbook/views/colorlistbox.cpp index 2bddca6..46a59a1 100644 --- a/kaddressbook/views/colorlistbox.cpp +++ b/kaddressbook/views/colorlistbox.cpp @@ -18,8 +18,13 @@ * */ #include <qpainter.h> +//Added by qt3to4: +#include <QDragEnterEvent> +#include <QDropEvent> +#include <QDragMoveEvent> +#include <QDragLeaveEvent> #include <kcolordialog.h> #ifndef KAB_EMBEDDED @@ -30,13 +35,13 @@ #ifdef DESKTOP_VERSION #include <qcolordialog.h> #endif -ColorListBox::ColorListBox( QWidget *parent, const char *name, WFlags f ) +ColorListBox::ColorListBox( QWidget *parent, const char *name, Qt::WFlags f ) :KListBox( parent, name, f ), mCurrentOnDragEnter(-1) { connect( this, SIGNAL(selected(int)), this, SLOT(newColor(int)) ); - connect( this, SIGNAL(clicked(QListBoxItem *)), this, SLOT(slotNewColor(QListBoxItem *)) ); + connect( this, SIGNAL(clicked(Q3ListBoxItem *)), this, SLOT(slotNewColor(Q3ListBoxItem *)) ); setAcceptDrops( true); } @@ -46,9 +51,9 @@ void ColorListBox::setEnabled( bool state ) { return; } - QListBox::setEnabled( state ); + Q3ListBox::setEnabled( state ); for( uint i=0; i<count(); i++ ) { updateItem( i ); } @@ -74,12 +79,12 @@ QColor ColorListBox::color( uint index ) const return( colorItem->color() ); } else { - return( black ); + return( Qt::black ); } } -void ColorListBox::slotNewColor(QListBoxItem * i) +void ColorListBox::slotNewColor(Q3ListBoxItem * i) { if ( i ) newColor( index( i ) ); } @@ -197,9 +202,9 @@ qDebug("ColorListBox::dropEvent drag&drop currently not supported"); ColorListItem::ColorListItem( const QString &text, const QColor &color ) - : QListBoxItem(), mColor( color ), mBoxWidth( 30 ) + : Q3ListBoxItem(), mColor( color ), mBoxWidth( 30 ) { setText( text ); } @@ -228,18 +233,18 @@ void ColorListItem::paint( QPainter *p ) p->fillRect( 4, 2, mBoxWidth-2, h-3, mColor ); } -int ColorListItem::height(const QListBox *lb ) const +int ColorListItem::height(const Q3ListBox *lb ) const { return( lb->fontMetrics().lineSpacing()+1 ); } -int ColorListItem::width(const QListBox *lb ) const +int ColorListItem::width(const Q3ListBox *lb ) const { return( mBoxWidth + lb->fontMetrics().width( text() ) + 6 ); } -#ifndef KAB_EMBEDDED -#include "colorlistbox.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_colorlistbox.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/views/colorlistbox.h b/kaddressbook/views/colorlistbox.h index bb91484..31a8085 100644 --- a/kaddressbook/views/colorlistbox.h +++ b/kaddressbook/views/colorlistbox.h @@ -21,8 +21,13 @@ #ifndef _COLOR_LISTBOX_H_ #define _COLOR_LISTBOX_H_ #include <klistbox.h> +//Added by qt3to4: +#include <QDragMoveEvent> +#include <QDragLeaveEvent> +#include <QDropEvent> +#include <QDragEnterEvent> class QDragEnterEvent; class QDragLeaveEvent; class QDragMoveEvent; @@ -32,9 +37,9 @@ class ColorListBox : public KListBox { Q_OBJECT public: - ColorListBox( QWidget *parent=0, const char * name=0, WFlags f=0 ); + ColorListBox( QWidget *parent=0, const char * name=0, Qt::WFlags f=0 ); void setColor( uint index, const QColor &color ); QColor color( uint index ) const; public slots: @@ -47,27 +52,27 @@ class ColorListBox : public KListBox void dropEvent( QDropEvent *e ); private slots: void newColor( int index ); - void slotNewColor(QListBoxItem * i); + void slotNewColor(Q3ListBoxItem * i); private: int mCurrentOnDragEnter; }; -class ColorListItem : public QListBoxItem +class ColorListItem : public Q3ListBoxItem { public: ColorListItem( const QString &text, const QColor &color=Qt::black ); const QColor &color( void ); void setColor( const QColor &color ); protected: virtual void paint( QPainter * ); - virtual int height( const QListBox * ) const; - virtual int width( const QListBox * ) const; + virtual int height( const Q3ListBox * ) const; + virtual int width( const Q3ListBox * ) const; private: QColor mColor; int mBoxWidth; diff --git a/kaddressbook/views/configurecardviewdialog.cpp b/kaddressbook/views/configurecardviewdialog.cpp index e0fbd21..b6327fe 100644 --- a/kaddressbook/views/configurecardviewdialog.cpp +++ b/kaddressbook/views/configurecardviewdialog.cpp @@ -24,13 +24,16 @@ #include <qstring.h> #include <qlayout.h> #include <qlabel.h> #include <qcheckbox.h> -#include <qvbox.h> -#include <qgroupbox.h> +#include <q3vbox.h> +#include <q3groupbox.h> #include <qspinbox.h> #include <qtabwidget.h> -#include <qwhatsthis.h> +#include <q3whatsthis.h> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3Frame> #include <kdebug.h> #include <kglobal.h> #include <kglobalsettings.h> @@ -88,9 +91,9 @@ void ConfigureCardViewWidget::saveSettings( KConfig *config ) //////////////////////// // CardViewLookNFeelPage CardViewLookNFeelPage::CardViewLookNFeelPage( QWidget *parent, const char *name ) - : QVBox( parent, name ) + : Q3VBox( parent, name ) { initGUI(); } @@ -233,87 +236,87 @@ void CardViewLookNFeelPage::initGUI() QTabWidget *tabs = new QTabWidget( this ); // Layout - QVBox *loTab = new QVBox( this, "layouttab" ); + Q3VBox *loTab = new Q3VBox( this, "layouttab" ); loTab->setSpacing( spacing ); loTab->setMargin( margin ); - QGroupBox *gbGeneral = new QGroupBox( 1, Qt::Horizontal, i18n("General"), loTab ); + Q3GroupBox *gbGeneral = new Q3GroupBox( 1, Qt::Horizontal, i18n("General"), loTab ); cbDrawSeps = new QCheckBox( i18n("Draw &separators"), gbGeneral ); - QHBox *hbSW = new QHBox( gbGeneral ); + Q3HBox *hbSW = new Q3HBox( gbGeneral ); QLabel *lSW = new QLabel( i18n("Separator &width:"), hbSW ); sbSepWidth = new QSpinBox( 1, 50, 1, hbSW ); lSW->setBuddy( sbSepWidth); - QHBox *hbPadding = new QHBox( gbGeneral ); + Q3HBox *hbPadding = new Q3HBox( gbGeneral ); QLabel *lSpacing = new QLabel( i18n("&Padding:"), hbPadding ); sbSpacing = new QSpinBox( 0, 100, 1, hbPadding ); lSpacing->setBuddy( sbSpacing ); - QGroupBox *gbCards = new QGroupBox( 1, Qt::Horizontal, i18n("Cards"), loTab ); + Q3GroupBox *gbCards = new Q3GroupBox( 1, Qt::Horizontal, i18n("Cards"), loTab ); - QHBox *hbMargin = new QHBox( gbCards ); + Q3HBox *hbMargin = new Q3HBox( gbCards ); QLabel *lMargin = new QLabel( i18n("&Margin:"), hbMargin ); sbMargin = new QSpinBox( 0, 100, 1, hbMargin ); lMargin->setBuddy( sbMargin ); cbDrawBorders = new QCheckBox( i18n("Draw &borders"), gbCards ); loTab->setStretchFactor( new QWidget( loTab ), 1 ); - QWhatsThis::add( sbMargin, i18n( + Q3WhatsThis::add( sbMargin, i18n( "The item margin is the distance (in pixels) between the item edge and the item data. Most noticeably, " "incrementing the item margin will add space between the focus rectangle and the item data." ) ); - QWhatsThis::add( lMargin, QWhatsThis::textFor( sbMargin ) ); - QWhatsThis::add( sbSpacing, i18n( + /* TODO:hacker: Q3WhatsThis::add( lMargin, Q3WhatsThis::textFor( sbMargin ) ); */ + Q3WhatsThis::add( sbSpacing, i18n( "The Item Spacing decides the distance (in pixels) between the items and anything else: the view " "borders, other items or column separators." ) ); - QWhatsThis::add( lSpacing, QWhatsThis::textFor( sbSpacing ) ); - QWhatsThis::add( sbSepWidth, i18n("Sets the width of column separators") ); - QWhatsThis::add( lSW, QWhatsThis::textFor( sbSepWidth ) ); + /* TODO:hacker: Q3WhatsThis::add( lSpacing, Q3WhatsThis::textFor( sbSpacing ) ); */ + Q3WhatsThis::add( sbSepWidth, i18n("Sets the width of column separators") ); + /* TODO:hacker: Q3WhatsThis::add( lSW, Q3WhatsThis::textFor( sbSepWidth ) ); */ tabs->addTab( loTab, i18n("&Layout") ); // Colors - QVBox *colorTab = new QVBox( this, "colortab" ); + Q3VBox *colorTab = new Q3VBox( this, "colortab" ); colorTab->setSpacing( spacing ); colorTab->setMargin( spacing ); cbEnableCustomColors = new QCheckBox( i18n("&Enable custom Colors"), colorTab ); connect( cbEnableCustomColors, SIGNAL(clicked()), this, SLOT(enableColors()) ); lbColors = new ColorListBox( colorTab ); tabs->addTab( colorTab, i18n("&Colors") ); - QWhatsThis::add( cbEnableCustomColors, i18n( + Q3WhatsThis::add( cbEnableCustomColors, i18n( "If custom colors are enabled, you may choose the colors for the view below. " "Otherwise colors from your current KDE color scheme are used." ) ); - QWhatsThis::add( lbColors, i18n( + Q3WhatsThis::add( lbColors, i18n( "Double click or press RETURN on a item to select a color for the related strings in the view." ) ); // Fonts - QVBox *fntTab = new QVBox( this, "fonttab" ); + Q3VBox *fntTab = new Q3VBox( this, "fonttab" ); fntTab->setSpacing( spacing ); fntTab->setMargin( spacing ); cbEnableCustomFonts = new QCheckBox( i18n("&Enable custom fonts"), fntTab ); connect( cbEnableCustomFonts, SIGNAL(clicked()), this, SLOT(enableFonts()) ); vbFonts = new QWidget( fntTab ); - QGridLayout *gFnts = new QGridLayout( vbFonts, 2, 3 ); + Q3GridLayout *gFnts = new Q3GridLayout( vbFonts, 2, 3 ); gFnts->setSpacing( spacing ); gFnts->setAutoAdd( true ); gFnts->setColStretch( 1, 1 ); QLabel *lTFnt = new QLabel( i18n("&Text font:"), vbFonts ); lTextFont = new QLabel( vbFonts ); - lTextFont->setFrameStyle( QFrame::Panel|QFrame::Sunken ); + lTextFont->setFrameStyle( Q3Frame::Panel|Q3Frame::Sunken ); #ifndef KAB_EMBEDDED btnFont = new KPushButton( i18n("Choose..."), vbFonts ); #else //KAB_EMBEDDED btnFont = new QPushButton( i18n("Choose..."), vbFonts ); @@ -324,9 +327,9 @@ void CardViewLookNFeelPage::initGUI() connect( btnFont, SIGNAL(clicked()), this, SLOT(setTextFont()) ); QLabel *lHFnt = new QLabel( i18n("&Header font:"), vbFonts ); lHeaderFont = new QLabel( vbFonts ); - lHeaderFont->setFrameStyle( QFrame::Panel|QFrame::Sunken ); + lHeaderFont->setFrameStyle( Q3Frame::Panel|Q3Frame::Sunken ); #ifndef KAB_EMBEDDED btnHeaderFont = new KPushButton( i18n("Choose..."), vbFonts ); #else //KAB_EMBEDDED btnHeaderFont = new QPushButton( i18n("Choose..."), vbFonts ); @@ -335,18 +338,18 @@ void CardViewLookNFeelPage::initGUI() connect( btnHeaderFont, SIGNAL(clicked()), this, SLOT(setHeaderFont()) ); fntTab->setStretchFactor( new QWidget( fntTab ), 1 ); - QWhatsThis::add( cbEnableCustomFonts, i18n( + Q3WhatsThis::add( cbEnableCustomFonts, i18n( "If custom fonts are enabled, you may choose which fonts to use for this view below. " "Otherwise the default KDE font will be used, in bold style for the header and " "normal style for the data." ) ); tabs->addTab( fntTab, i18n("&Fonts") ); // Behaviour - QVBox *behaviourTab = new QVBox( this ); + Q3VBox *behaviourTab = new Q3VBox( this ); behaviourTab->setMargin( margin ); behaviourTab->setSpacing( spacing ); cbShowEmptyFields = new QCheckBox( i18n("Show &empty fields"), behaviourTab ); @@ -363,7 +366,7 @@ void CardViewLookNFeelPage::updateFontLabel( QFont fnt, QLabel *l ) l->setFont( fnt ); l->setText( QString( fnt.family() + " %1" ).arg( fnt.pointSize() ) ); } -#ifndef KAB_EMBEDDED -#include "configurecardviewdialog.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_configurecardviewdialog.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/views/configurecardviewdialog.h b/kaddressbook/views/configurecardviewdialog.h index 7a62226..4af475d 100644 --- a/kaddressbook/views/configurecardviewdialog.h +++ b/kaddressbook/views/configurecardviewdialog.h @@ -25,11 +25,13 @@ #define CONFIGURECARDVIEWDIALOG_H #include "viewconfigurewidget.h" -#include <qvbox.h> +#include <q3vbox.h> #include <qwidget.h> #include <qfont.h> +//Added by qt3to4: +#include <QLabel> class QString; class QWidget; class QCheckBox; @@ -76,9 +78,9 @@ class ConfigureCardViewWidget : public ViewConfigureWidget * item margin * item spacing */ -class CardViewLookNFeelPage : public QVBox { +class CardViewLookNFeelPage : public Q3VBox { Q_OBJECT public: diff --git a/kaddressbook/views/configuretableviewdialog.cpp b/kaddressbook/views/configuretableviewdialog.cpp index c329cd9..7ed897a 100644 --- a/kaddressbook/views/configuretableviewdialog.cpp +++ b/kaddressbook/views/configuretableviewdialog.cpp @@ -26,13 +26,16 @@ #include <qlayout.h> #include <qlabel.h> #include <qradiobutton.h> #include <qcheckbox.h> -#include <qvbox.h> -#include <qbuttongroup.h> +#include <q3vbox.h> +#include <q3buttongroup.h> #include <qtabwidget.h> -#include <qwhatsthis.h> +#include <q3whatsthis.h> #include <qpushbutton.h> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3Frame> #include <kglobal.h> #include <klocale.h> #include <klineedit.h> @@ -83,9 +86,9 @@ void ConfigureTableViewWidget::saveSettings( KConfig *config ) LookAndFeelPage::LookAndFeelPage(QWidget *parent, const char *name) - : QVBox(parent, name) + : Q3VBox(parent, name) { initGUI(); // Set initial state @@ -228,14 +231,14 @@ void LookAndFeelPage::initGUI() QTabWidget *tabs = new QTabWidget( this ); // General - QVBox *generalTab = new QVBox( this, "generaltab" ); + Q3VBox *generalTab = new Q3VBox( this, "generaltab" ); generalTab->setSpacing( spacing ); generalTab->setMargin( margin ); - QButtonGroup *group = new QButtonGroup(1, Qt::Horizontal, + Q3ButtonGroup *group = new Q3ButtonGroup(1, Qt::Horizontal, i18n("Row Separator"), generalTab); mAlternateButton = new QRadioButton(i18n("Alternating backgrounds"), group, "mAlternateButton"); @@ -261,41 +264,41 @@ void LookAndFeelPage::initGUI() tabs->addTab( generalTab, i18n("&General") ); // Colors - QVBox *colorTab = new QVBox( this, "colortab" ); + Q3VBox *colorTab = new Q3VBox( this, "colortab" ); colorTab->setSpacing( spacing ); colorTab->setMargin( spacing ); cbEnableCustomColors = new QCheckBox( i18n("&Enable custom Colors"), colorTab ); connect( cbEnableCustomColors, SIGNAL(clicked()), this, SLOT(enableColors()) ); lbColors = new ColorListBox( colorTab ); tabs->addTab( colorTab, i18n("&Colors") ); - QWhatsThis::add( cbEnableCustomColors, i18n( + Q3WhatsThis::add( cbEnableCustomColors, i18n( "If custom colors are enabled, you may choose the colors for the view below. " "Otherwise colors from your current KDE color scheme are used." ) ); - QWhatsThis::add( lbColors, i18n( + Q3WhatsThis::add( lbColors, i18n( "Double click or press RETURN on a item to select a color for the related strings in the view." ) ); // Fonts - QVBox *fntTab = new QVBox( this, "fonttab" ); + Q3VBox *fntTab = new Q3VBox( this, "fonttab" ); fntTab->setSpacing( spacing ); fntTab->setMargin( spacing ); cbEnableCustomFonts = new QCheckBox( i18n("&Enable custom fonts"), fntTab ); connect( cbEnableCustomFonts, SIGNAL(clicked()), this, SLOT(enableFonts()) ); vbFonts = new QWidget( fntTab ); - QGridLayout *gFnts = new QGridLayout( vbFonts, 2, 3 ); + Q3GridLayout *gFnts = new Q3GridLayout( vbFonts, 2, 3 ); gFnts->setSpacing( spacing ); gFnts->setAutoAdd( true ); gFnts->setColStretch( 1, 1 ); QLabel *lTFnt = new QLabel( i18n("&Text font:"), vbFonts ); lTextFont = new QLabel( vbFonts ); - lTextFont->setFrameStyle( QFrame::Panel|QFrame::Sunken ); + lTextFont->setFrameStyle( Q3Frame::Panel|Q3Frame::Sunken ); #ifndef KAB_EMBEDDED btnFont = new KPushButton( i18n("Choose..."), vbFonts ); #else //KAB_EMBEDDED btnFont = new QPushButton( i18n("Choose..."), vbFonts ); @@ -306,9 +309,9 @@ void LookAndFeelPage::initGUI() connect( btnFont, SIGNAL(clicked()), this, SLOT(setTextFont()) ); QLabel *lHFnt = new QLabel( i18n("&Header font:"), vbFonts ); lHeaderFont = new QLabel( vbFonts ); - lHeaderFont->setFrameStyle( QFrame::Panel|QFrame::Sunken ); + lHeaderFont->setFrameStyle( Q3Frame::Panel|Q3Frame::Sunken ); #ifndef KAB_EMBEDDED btnHeaderFont = new KPushButton( i18n("Choose..."), vbFonts ); #else //KAB_EMBEDDED btnHeaderFont = new QPushButton( i18n("Choose..."), vbFonts ); @@ -317,9 +320,9 @@ void LookAndFeelPage::initGUI() connect( btnHeaderFont, SIGNAL(clicked()), this, SLOT(setHeaderFont()) ); fntTab->setStretchFactor( new QWidget( fntTab ), 1 ); - QWhatsThis::add( cbEnableCustomFonts, i18n( + Q3WhatsThis::add( cbEnableCustomFonts, i18n( "If custom fonts are enabled, you may choose which fonts to use for this view below. " "Otherwise the default KDE font will be used, in bold style for the header and " "normal style for the data." ) ); @@ -339,7 +342,7 @@ void LookAndFeelPage::updateFontLabel( QFont fnt, QLabel *l ) l->setFont( fnt ); l->setText( QString( fnt.family() + " %1" ).arg( fnt.pointSize() ) ); } -#ifndef KAB_EMBEDDED -#include "configuretableviewdialog.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_configuretableviewdialog.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/views/configuretableviewdialog.h b/kaddressbook/views/configuretableviewdialog.h index 003ccf8..8125fc9 100644 --- a/kaddressbook/views/configuretableviewdialog.h +++ b/kaddressbook/views/configuretableviewdialog.h @@ -25,9 +25,11 @@ #define CONFIGURETABLEVIEWDIALOG_H #include "viewconfigurewidget.h" -#include <qvbox.h> +#include <q3vbox.h> +//Added by qt3to4: +#include <QLabel> class QString; class QWidget; class QRadioButton; @@ -62,9 +64,9 @@ class ConfigureTableViewWidget : public ViewConfigureWidget /** Internal class. It is only defined here for moc */ -class LookAndFeelPage : public QVBox +class LookAndFeelPage : public Q3VBox { Q_OBJECT public: diff --git a/kaddressbook/views/contactlistview.cpp b/kaddressbook/views/contactlistview.cpp index 9accf78..227645d 100644 --- a/kaddressbook/views/contactlistview.cpp +++ b/kaddressbook/views/contactlistview.cpp @@ -20,17 +20,22 @@ with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ -#include <qheader.h> -#include <qiconset.h> +#include <q3header.h> +#include <qicon.h> #include <qimage.h> -#include <qdragobject.h> +#include <q3dragobject.h> #include <qcombobox.h> #include <qpainter.h> #include <qbrush.h> #include <qevent.h> #include <qapplication.h> +//Added by qt3to4: +#include <QDropEvent> +#include <QPixmap> +#include <QMouseEvent> +#include <QKeyEvent> #include <klocale.h> #include <kglobalsettings.h> #include <kiconloader.h> @@ -46,14 +51,15 @@ ///////////////////////////////// // DynamicTip Methods DynamicTip::DynamicTip( ContactListView *parent) - : QToolTip( parent ) + /* TODO:hacker:: QToolTip( parent ) */ { } void DynamicTip::maybeTip( const QPoint &pos ) { + /* TODO:hacker: static bool ishidden = true; if (!parentWidget()->inherits( "ContactListView" )) return; @@ -62,9 +68,9 @@ void DynamicTip::maybeTip( const QPoint &pos ) return; QPoint posVp = plv->viewport()->pos(); - QListViewItem *lvi = plv->itemAt( pos - posVp ); + Q3ListViewItem *lvi = plv->itemAt( pos - posVp ); if (!lvi) return; #ifndef KAB_EMBEDDED @@ -150,9 +156,9 @@ void DynamicTip::maybeTip( const QPoint &pos ) } else hide(); ishidden = !ishidden; - + */ } /////////////////////////// // ContactListViewItem Methods @@ -172,9 +178,9 @@ QString ContactListViewItem::key(int column, bool ascending) const #ifndef DESKTOP_VERSION int lan = KGlobal::locale()->language(); //qDebug("language %d ", lan); if ( lan == 1 ) { //GERMAN - QString ret = QListViewItem::key(column, ascending).lower().utf8(); + QString ret = Q3ListViewItem::key(column, ascending).lower().utf8(); int start = -1; while ( (start = ret.find( 'ä', start+1)) > 0 ) { ret.at(start-1) = 'a'; } @@ -196,9 +202,9 @@ QString ContactListViewItem::key(int column, bool ascending) const } else #endif - return QListViewItem::key(column, ascending).lower(); + return Q3ListViewItem::key(column, ascending).lower(); } void ContactListViewItem::paintCell(QPainter * p, const QColorGroup & cg, @@ -287,9 +293,9 @@ void ContactListView::printMe() if (!printer.setup() ) return; QPainter p; p.begin ( &printer ); - QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); + Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( &printer ); float dx, dy; int wid = (m.width() * 9)/10; dx = (float) wid/(float)contentsWidth (); dy = (float)(m.height()) / (float)contentsHeight (); @@ -342,9 +348,9 @@ void ContactListView::contentsMousePressEvent(QMouseEvent* e) // To initiate a drag operation void ContactListView::contentsMouseMoveEvent( QMouseEvent *e ) { - if ((e->state() & LeftButton) && (e->pos() - presspos).manhattanLength() > 4 ) { + if ((e->state() & Qt::LeftButton) && (e->pos() - presspos).manhattanLength() > 4 ) { emit startAddresseeDrag(); } else KListView::contentsMouseMoveEvent( e ); @@ -352,9 +358,9 @@ void ContactListView::contentsMouseMoveEvent( QMouseEvent *e ) bool ContactListView::acceptDrag(QDropEvent *e) const { #ifndef KAB_EMBEDDED - return QTextDrag::canDecode(e); + return Q3TextDrag::canDecode(e); #else //KAB_EMBEDDED qDebug("ContactListView::acceptDrag has to be fixed"); return false; #endif //KAB_EMBEDDED @@ -423,7 +429,7 @@ void ContactListView::keyReleaseEvent ( QKeyEvent * e ) mFlagKeyPressed = false; } KListView::keyReleaseEvent ( e ); } -#ifndef KAB_EMBEDDED -#include "contactlistview.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_contactlistview.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/views/contactlistview.h b/kaddressbook/views/contactlistview.h index 46477e1..c92b002 100644 --- a/kaddressbook/views/contactlistview.h +++ b/kaddressbook/views/contactlistview.h @@ -4,8 +4,12 @@ #include <qcolor.h> #include <qpixmap.h> #include <qtooltip.h> #include <qstring.h> +//Added by qt3to4: +#include <QDropEvent> +#include <QMouseEvent> +#include <QKeyEvent> #include <klistview.h> #include <kabc/field.h> @@ -19,9 +23,9 @@ class ContactListView; /** The whole tooltip design needs a lot of work. Currently it is * hacked together to function. */ -class DynamicTip : public QToolTip +class DynamicTip /* TODO:hacker: : public QToolTip */ { public: DynamicTip( ContactListView * parent ); diff --git a/kaddressbook/views/kaddressbookcardview.cpp b/kaddressbook/views/kaddressbookcardview.cpp index b503652..1e5a556 100644 --- a/kaddressbook/views/kaddressbookcardview.cpp +++ b/kaddressbook/views/kaddressbookcardview.cpp @@ -20,15 +20,20 @@ with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ -#include <qdragobject.h> +#include <q3dragobject.h> #include <qevent.h> -#include <qiconview.h> +#include <q3iconview.h> #include <qlayout.h> #include <qstringlist.h> #include <qregexp.h> #include <qapplication.h> +//Added by qt3to4: +#include <QDropEvent> +#include <QKeyEvent> +#include <Q3VBoxLayout> +#include <QDragEnterEvent> #include <kabc/addressbook.h> #include <kabc/addressee.h> #include <kconfig.h> @@ -124,9 +129,9 @@ void AddresseeCardView::printMe() if (!printer.setup() ) return; QPainter p; p.begin ( &printer ); - QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); + Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( &printer ); float dx, dy; int wid = (m.width() * 9)/10; dx = (float) wid/(float)contentsWidth (); dy = (float)(m.height()) / (float)contentsHeight (); @@ -147,9 +152,9 @@ void AddresseeCardView::printMe() void AddresseeCardView::dragEnterEvent(QDragEnterEvent *e) { #ifndef KAB_EMBEDDED - if (QTextDrag::canDecode(e)) + if (Q3TextDrag::canDecode(e)) e->accept(); #else //KAB_EMBEDDED qDebug("AddresseeCardView::dragEnterEvent drag&drop is not implemented"); #endif //KAB_EMBEDDED @@ -175,9 +180,9 @@ KAddressBookCardView::KAddressBookCardView( KABC::AddressBook *ab, { mShowEmptyFields = false; // Init the GUI - QVBoxLayout *layout = new QVBoxLayout(viewWidget()); + Q3VBoxLayout *layout = new Q3VBoxLayout(viewWidget()); mCardView = new AddresseeCardView(viewWidget(), "mCardView"); mCardView->setSelectionMode(CardView::Extended); layout->addWidget(mCardView); @@ -519,7 +524,7 @@ void KAddressBookCardView::addresseeSelected() if (!found) emit selected(QString::null); } -#ifndef KAB_EMBEDDED -#include "kaddressbookcardview.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_kaddressbookcardview.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/views/kaddressbookcardview.h b/kaddressbook/views/kaddressbookcardview.h index 2a71f7e..8f8e48b 100644 --- a/kaddressbook/views/kaddressbookcardview.h +++ b/kaddressbook/views/kaddressbookcardview.h @@ -24,8 +24,11 @@ without including the source code for Qt in the source distribution. */ #include <qstring.h> +//Added by qt3to4: +#include <QDragEnterEvent> +#include <QDropEvent> #ifndef KAB_EMBEDDED #include <kiconview.h> #else //KAB_EMBEDDED #include <klocale.h> diff --git a/kaddressbook/views/kaddressbookiconview.cpp b/kaddressbook/views/kaddressbookiconview.cpp index d6ddec3..3a41a4b 100644 --- a/kaddressbook/views/kaddressbookiconview.cpp +++ b/kaddressbook/views/kaddressbookiconview.cpp @@ -21,9 +21,9 @@ without including the source code for Qt in the source distribution. */ #ifndef KAB_EMBEDDED -#include <qiconview.h> +#include <q3iconview.h> #include <qstringlist.h> #include <kabc/addressee.h> #include <kconfig.h> @@ -34,8 +34,16 @@ #else //KAB_EMBEDDED #endif //KAB_EMBEDDED +//Added by qt3to4: +#include <QDropEvent> +#include <Q3ValueList> +#include <QPixmap> +#include <QKeyEvent> +#include <QEvent> +#include <Q3VBoxLayout> + #include <kabc/addressbook.h> #include "kabprefs.h" #include "viewmanager.h" #include "kaddressbookiconview.h" @@ -72,14 +80,14 @@ extern "C" { AddresseeIconView::AddresseeIconView(QWidget *parent, const char *name) : KIconView(parent, name) #else //KAB_EMBEDDED AddresseeIconView::AddresseeIconView(QWidget *parent, const char *name) - : QIconView(parent, name) + : Q3IconView(parent, name) #endif //KAB_EMBEDDED { - setSelectionMode( QIconView::Extended ); - setResizeMode( QIconView::Adjust ); + setSelectionMode( Q3IconView::Extended ); + setResizeMode( Q3IconView::Adjust ); setWordWrapIconText( true ); setGridX( 100 ); setItemsMovable(false); setSorting(true, true); @@ -88,10 +96,10 @@ AddresseeIconView::AddresseeIconView(QWidget *parent, const char *name) //US ??? setMode( KIconView::Select ); #ifndef KAB_EMBEDDED - connect(this, SIGNAL(dropped(QDropEvent*, const QValueList<QIconDragItem>&)), - this, SLOT(itemDropped(QDropEvent*, const QValueList<QIconDragItem>&))); + connect(this, SIGNAL(dropped(QDropEvent*, const Q3ValueList<Q3IconDragItem>&)), + this, SLOT(itemDropped(QDropEvent*, const Q3ValueList<Q3IconDragItem>&))); #endif //KAB_EMBEDDED } AddresseeIconView::~AddresseeIconView() @@ -99,14 +107,14 @@ AddresseeIconView::~AddresseeIconView() } void AddresseeIconView::itemDropped(QDropEvent *e, - const QValueList<QIconDragItem> &) + const Q3ValueList<Q3IconDragItem> &) { emit addresseeDropped(e); } -QDragObject *AddresseeIconView::dragObject() +Q3DragObject *AddresseeIconView::dragObject() { emit startAddresseeDrag(); // We never want IconView to start the drag @@ -116,22 +124,22 @@ QDragObject *AddresseeIconView::dragObject() // AddresseeIconViewItem (internal class) #ifndef KAB_EMBEDDED class AddresseeIconViewItem : public KIconViewItem #else //KAB_EMBEDDED -class AddresseeIconViewItem : public QIconViewItem +class AddresseeIconViewItem : public Q3IconViewItem #endif //KAB_EMBEDDED { public: #ifndef KAB_EMBEDDED AddresseeIconViewItem(const KABC::Field::List &fields, KABC::AddressBook *doc, const KABC::Addressee &a, - QIconView *parent) + Q3IconView *parent) : KIconViewItem(parent), mFields( fields ), mDocument(doc), mAddressee(a) #else //KAB_EMBEDDED AddresseeIconViewItem(const KABC::Field::List &fields, KABC::AddressBook *doc, const KABC::Addressee &a, - QIconView *parent) - : QIconViewItem(parent), mFields( fields ), mDocument(doc), mAddressee(a) + Q3IconView *parent) + : Q3IconViewItem(parent), mFields( fields ), mDocument(doc), mAddressee(a) #endif //KAB_EMBEDDED { if ( mFields.isEmpty() ) { mFields = KABC::Field::defaultFields(); @@ -199,9 +207,9 @@ KAddressBookIconView::KAddressBookIconView( KABC::AddressBook *ab, QWidget *parent, const char *name) : KAddressBookView( ab, parent, name ) { // Init the GUI - QVBoxLayout *layout = new QVBoxLayout(viewWidget()); + Q3VBoxLayout *layout = new Q3VBoxLayout(viewWidget()); mIconView = new AddresseeIconView(viewWidget(), "mIconView"); layout->addWidget(mIconView); @@ -209,10 +217,10 @@ KAddressBookIconView::KAddressBookIconView( KABC::AddressBook *ab, //US method executed is part of KIconView //US connect(mIconView, SIGNAL(executed(QIconViewItem *)), //US this, SLOT(addresseeExecuted(QIconViewItem *))); - connect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)), - this, SLOT(addresseeExecuted(QIconViewItem *))); + connect(mIconView, SIGNAL(selectionChanged(Q3IconViewItem *)), + this, SLOT(addresseeExecuted(Q3IconViewItem *))); connect(mIconView, SIGNAL(selectionChanged()), this, SLOT(addresseeSelected())); connect(mIconView, SIGNAL(addresseeDropped(QDropEvent*)), @@ -247,10 +255,10 @@ void KAddressBookIconView::readConfig(KConfig *config) //US method executed is part of KIconView //US disconnect(mIconView, SIGNAL(executed(QIconViewItem *)), //US this, SLOT(addresseeExecuted(QIconViewItem *))); - disconnect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)), - this, SLOT(addresseeExecuted(QIconViewItem *))); + disconnect(mIconView, SIGNAL(selectionChanged(Q3IconViewItem *)), + this, SLOT(addresseeExecuted(Q3IconViewItem *))); //US method executed is part of KIconView. Use selectionChanged instead /*US if (KABPrefs::instance()->mHonorSingleClick) @@ -259,10 +267,10 @@ void KAddressBookIconView::readConfig(KConfig *config) else connect(mIconView, SIGNAL(doubleClicked(QIconViewItem *)), this, SLOT(addresseeExecuted(QIconViewItem *))); */ - connect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)), - this, SLOT(addresseeExecuted(QIconViewItem *))); + connect(mIconView, SIGNAL(selectionChanged(Q3IconViewItem *)), + this, SLOT(addresseeExecuted(Q3IconViewItem *))); } void KAddressBookIconView::doSearch( const QString& s ,KABC::Field *field ) { @@ -335,9 +343,9 @@ void KAddressBookIconView::doSearch( const QString& s ,KABC::Field *field ) } QStringList KAddressBookIconView::selectedUids() { QStringList uidList; - QIconViewItem *item; + Q3IconViewItem *item; AddresseeIconViewItem *aItem; for (item = mIconView->firstItem(); item; item = item->nextItem()) { @@ -357,9 +365,9 @@ QStringList KAddressBookIconView::selectedUids() } void KAddressBookIconView::refresh(QString uid) { - QIconViewItem *item; + Q3IconViewItem *item; AddresseeIconViewItem *aItem; if ( uid.isNull() ) { // Rebuild the view @@ -405,9 +413,9 @@ void KAddressBookIconView::refresh(QString uid) } void KAddressBookIconView::setSelected(QString uid, bool selected) { - QIconViewItem *item; + Q3IconViewItem *item; AddresseeIconViewItem *aItem; if (uid.isNull()) { @@ -434,9 +442,9 @@ void KAddressBookIconView::setSelected(QString uid, bool selected) } } } -void KAddressBookIconView::addresseeExecuted(QIconViewItem *item) +void KAddressBookIconView::addresseeExecuted(Q3IconViewItem *item) { #ifndef KAB_EMBEDDED AddresseeIconViewItem *aItem = dynamic_cast<AddresseeIconViewItem*>(item); #else //KAB_EMBEDDED @@ -449,9 +457,9 @@ void KAddressBookIconView::addresseeExecuted(QIconViewItem *item) } void KAddressBookIconView::addresseeSelected() { - QIconViewItem *item; + Q3IconViewItem *item; AddresseeIconViewItem *aItem; bool found = false; for (item = mIconView->firstItem(); item && !found; @@ -475,7 +483,7 @@ void KAddressBookIconView::addresseeSelected() if (!found) emit selected(QString::null); } -#ifndef KAB_EMBEDDED -#include "kaddressbookiconview.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_kaddressbookiconview.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/views/kaddressbookiconview.h b/kaddressbook/views/kaddressbookiconview.h index b0b9fea..6fad4c6 100644 --- a/kaddressbook/views/kaddressbookiconview.h +++ b/kaddressbook/views/kaddressbookiconview.h @@ -24,22 +24,25 @@ #ifndef KADDRESSBOOKICONVIEW_H #define KADDRESSBOOKICONVIEW_H #include <qstring.h> +//Added by qt3to4: +#include <Q3ValueList> +#include <QDropEvent> #ifndef KAB_EMBEDDED #include <kiconview.h> #else //KAB_EMBEDDED -#include <qiconview.h> -#include <qptrlist.h> +#include <q3iconview.h> +#include <q3ptrlist.h> #include <klocale.h> #endif //KAB_EMBEDDED #include "kaddressbookview.h" -class QIconViewItem; +class Q3IconViewItem; class KConfig; class AddresseeIconView; class AddresseeIconViewItem; -class QIconDragItem; +class Q3IconDragItem; class KAddressBookIconView; namespace KABC { class AddressBook; } @@ -67,32 +70,32 @@ class KAddressBookIconView : public KAddressBookView public slots: void refresh(QString uid = QString::null); #ifndef KAB_EMBEDDED -//MOC_SKIP_BEGIN +#ifndef Q_MOC_RUN void setSelected(QString uid = QString::null, bool selected = true); -//MOC_SKIP_END +#endif #else //KAB_EMBEDDED //US my MOC do not like default parameters ??? void setSelected(QString uid, bool selected); #endif //KAB_EMBEDDED protected slots: - void addresseeExecuted(QIconViewItem *item); + void addresseeExecuted(Q3IconViewItem *item); void addresseeSelected(); private: AddresseeIconView *mIconView; - QPtrList<AddresseeIconViewItem> mIconList; + Q3PtrList<AddresseeIconViewItem> mIconList; }; #ifndef KAB_EMBEDDED -//MOC_SKIP_BEGIN +#ifndef Q_MOC_RUN class AddresseeIconView : public KIconView -//MOC_SKIP_END +#endif #else //KAB_EMBEDDED -class AddresseeIconView : public QIconView +class AddresseeIconView : public Q3IconView #endif //KAB_EMBEDDED { Q_OBJECT @@ -104,12 +107,12 @@ class AddresseeIconView : public QIconView void addresseeDropped(QDropEvent *); void startAddresseeDrag(); protected: - virtual QDragObject *dragObject(); + virtual Q3DragObject *dragObject(); protected slots: - void itemDropped(QDropEvent *, const QValueList<QIconDragItem> &); + void itemDropped(QDropEvent *, const Q3ValueList<Q3IconDragItem> &); }; class IconViewFactory : public ViewFactory { diff --git a/kaddressbook/views/kaddressbooktableview.cpp b/kaddressbook/views/kaddressbooktableview.cpp index 272f2eb..7efaaa9 100644 --- a/kaddressbook/views/kaddressbooktableview.cpp +++ b/kaddressbook/views/kaddressbooktableview.cpp @@ -1,17 +1,21 @@ // $Id$ -#include <qvbox.h> -#include <qlistbox.h> +#include <q3vbox.h> +#include <q3listbox.h> #include <qwidget.h> #include <qfile.h> #include <qimage.h> #include <qcombobox.h> #include <qapplication.h> -#include <qdragobject.h> +#include <q3dragobject.h> #include <qevent.h> -#include <qurl.h> +#include <q3url.h> #include <qpixmap.h> +//Added by qt3to4: +#include <QDropEvent> +#include <QKeyEvent> +#include <Q3VBoxLayout> #include <kabc/addressbook.h> #include <kapplication.h> #include <kconfig.h> @@ -31,9 +35,9 @@ #include "undocmds.h" #include "viewmanager.h" #include <qlayout.h> -#include <qheader.h> +#include <q3header.h> #include <qregexp.h> #include "kaddressbooktableview.h" @@ -41,9 +45,9 @@ KAddressBookTableView::KAddressBookTableView( KABC::AddressBook *ab, QWidget *parent, const char *name ) : KAddressBookView( ab, parent, name ) { - mainLayout = new QVBoxLayout( viewWidget(), 2 ); + mainLayout = new Q3VBoxLayout( viewWidget(), 2 ); // The list view will be created when the config is read. mListView = 0; } @@ -76,16 +80,16 @@ void KAddressBookTableView::reconstructListView() if (mListView) { disconnect(mListView, SIGNAL(selectionChanged()), this, SLOT(addresseeSelected())); - disconnect(mListView, SIGNAL(executed(QListViewItem*)), - this, SLOT(addresseeExecuted(QListViewItem*))); - disconnect(mListView, SIGNAL(doubleClicked(QListViewItem*)), - this, SLOT(addresseeExecuted(QListViewItem*))); + disconnect(mListView, SIGNAL(executed(Q3ListViewItem*)), + this, SLOT(addresseeExecuted(Q3ListViewItem*))); + disconnect(mListView, SIGNAL(doubleClicked(Q3ListViewItem*)), + this, SLOT(addresseeExecuted(Q3ListViewItem*))); disconnect(mListView, SIGNAL(startAddresseeDrag()), this, SIGNAL(startDrag())); - disconnect(mListView, SIGNAL(returnPressed(QListViewItem*)), - this, SLOT(addresseeExecuted(QListViewItem*))); + disconnect(mListView, SIGNAL(returnPressed(Q3ListViewItem*)), + this, SLOT(addresseeExecuted(Q3ListViewItem*))); disconnect(mListView, SIGNAL(addresseeDropped(QDropEvent*)), this, SIGNAL(dropped(QDropEvent*))); delete mListView; @@ -104,9 +108,9 @@ void KAddressBookTableView::reconstructListView() int c = 0; for( it = fieldList.begin(); it != fieldList.end(); ++it ) { mListView->addColumn( (*it)->label() ); - mListView->setColumnWidthMode(c++, QListView::Manual); + mListView->setColumnWidthMode(c++, Q3ListView::Manual); //US // qDebug("KAddressBookTableView::reconstructListView: field %s", (*it)->label().latin1()); } @@ -118,17 +122,17 @@ void KAddressBookTableView::reconstructListView() SIGNAL(dropped(QDropEvent*))); if (KABPrefs::instance()->mHonorSingleClick) { // qDebug("KAddressBookTableView::reconstructListView single"); - connect(mListView, SIGNAL(executed(QListViewItem*)), - this, SLOT(addresseeExecuted(QListViewItem*))); + connect(mListView, SIGNAL(executed(Q3ListViewItem*)), + this, SLOT(addresseeExecuted(Q3ListViewItem*))); } else { // qDebug("KAddressBookTableView::reconstructListView double"); - connect(mListView, SIGNAL(doubleClicked(QListViewItem*)), - this, SLOT(addresseeExecuted(QListViewItem*))); + connect(mListView, SIGNAL(doubleClicked(Q3ListViewItem*)), + this, SLOT(addresseeExecuted(Q3ListViewItem*))); } - connect(mListView, SIGNAL(returnPressed(QListViewItem*)), - this, SLOT(addresseeExecuted(QListViewItem*))); + connect(mListView, SIGNAL(returnPressed(Q3ListViewItem*)), + this, SLOT(addresseeExecuted(Q3ListViewItem*))); connect(mListView, SIGNAL(signalDelete()), this, SLOT(addresseeDeleted())); //US performceimprovement. Refresh is done from the outside @@ -343,9 +347,9 @@ void KAddressBookTableView::refresh(QString uid) } } else { // Only need to update on entry. Iterate through and try to find it ContactListViewItem *ceItem; - QListViewItemIterator it( mListView ); + Q3ListViewItemIterator it( mListView ); while ( it.current() ) { #ifndef KAB_EMBEDDED ceItem = dynamic_cast<ContactListViewItem*>( it.current() ); #else //KAB_EMBEDDED @@ -365,9 +369,9 @@ void KAddressBookTableView::refresh(QString uid) QStringList KAddressBookTableView::selectedUids() { QStringList uidList; - QListViewItem *item; + Q3ListViewItem *item; ContactListViewItem *ceItem; for(item = mListView->firstChild(); item; item = item->itemBelow()) { @@ -393,9 +397,9 @@ QStringList KAddressBookTableView::selectedUids() } void KAddressBookTableView::setSelected(QString uid, bool selected) { - QListViewItem *item; + Q3ListViewItem *item; ContactListViewItem *ceItem; if (uid.isNull()) { @@ -428,9 +432,9 @@ void KAddressBookTableView::addresseeSelected() // We need to try to find the first selected item. This might not be the // last selected item, but when QListView is in multiselection mode, // there is no way to figure out which one was // selected last. - QListViewItem *item; + Q3ListViewItem *item; bool found =false; for (item = mListView->firstChild(); item && !found; item = item->nextSibling()) { @@ -452,9 +456,9 @@ void KAddressBookTableView::addresseeSelected() if (!found) emit selected(QString::null); } -void KAddressBookTableView::addresseeExecuted(QListViewItem *item) +void KAddressBookTableView::addresseeExecuted(Q3ListViewItem *item) { if (item) { #ifndef KAB_EMBEDDED @@ -486,7 +490,7 @@ void KAddressBookTableView::addresseeDeleted() -#ifndef KAB_EMBEDDED -#include "kaddressbooktableview.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_kaddressbooktableview.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/views/kaddressbooktableview.h b/kaddressbook/views/kaddressbooktableview.h index 38db7b4..c3cb038 100644 --- a/kaddressbook/views/kaddressbooktableview.h +++ b/kaddressbook/views/kaddressbooktableview.h @@ -9,14 +9,14 @@ #include <config.h> #endif #include <qwidget.h> -#include <qlistview.h> +#include <q3listview.h> #include <qstring.h> #include <qdialog.h> -#include <qtabdialog.h> +#include <q3tabdialog.h> #include <qstringlist.h> -#include <qvaluelist.h> +#include <q3valuelist.h> #include "undo.h" #else //KAB_EMBEDDED @@ -24,12 +24,14 @@ #endif //KAB_EMBEDDED #include "klocale.h" #include "kaddressbookview.h" +//Added by qt3to4: +#include <Q3VBoxLayout> -class QListViewItem; -class QListBox; -class QVBoxLayout; +class Q3ListViewItem; +class Q3ListBox; +class Q3VBoxLayout; class KConfig; class ContactListViewItem; class ContactListView; @@ -78,12 +80,12 @@ friend class ContactListView; /** Called whenever the user executes an addressee. In terms of the * list view, this is probably a double click */ - void addresseeExecuted(QListViewItem*); + void addresseeExecuted(Q3ListViewItem*); private: - QVBoxLayout *mainLayout; + Q3VBoxLayout *mainLayout; ContactListView *mListView; }; diff --git a/kaddressbook/xxport/csv_xxport.cpp b/kaddressbook/xxport/csv_xxport.cpp index 7281003..ed5807f 100644 --- a/kaddressbook/xxport/csv_xxport.cpp +++ b/kaddressbook/xxport/csv_xxport.cpp @@ -29,9 +29,9 @@ $Id$ */ #include <qfile.h> #include <qregexp.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qtextcodec.h> #include <kfiledialog.h> #ifndef KAB_EMBEDDED @@ -103,9 +103,9 @@ bool CSVXXPort::exportContacts( const KABC::AddresseeList &list, const QString& return KIO::NetAccess::upload( tmpFile.name(), url, parentWidget() ); } else { QFile file( url.path() ); - if ( !file.open( IO_WriteOnly ) ) { + if ( !file.open( QIODevice::WriteOnly ) ) { QString txt = i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ); KMessageBox::error( parentWidget(), txt.arg( url.path() ) ); return false; } @@ -123,9 +123,9 @@ bool CSVXXPort::exportContacts( const KABC::AddresseeList &list, const QString& if ( fileName.isEmpty() ) return false; QFile file( fileName ); - if ( !file.open( IO_WriteOnly ) ) { + if ( !file.open( QIODevice::WriteOnly ) ) { QString txt = i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ); KMessageBox::error( parentWidget(), txt.arg( fileName ) ); return false; } @@ -150,9 +150,9 @@ KABC::AddresseeList CSVXXPort::importContacts( const QString& ) const } void CSVXXPort::doExport( QFile *fp, const KABC::AddresseeList &list ) { - QTextStream t( fp ); + Q3TextStream t( fp ); t.setCodec( QTextCodec::codecForName("utf8") ); KABC::AddresseeList::ConstIterator iter; KABC::Field::List fields = addressBook()->fields(); @@ -186,9 +186,7 @@ void CSVXXPort::doExport( QFile *fp, const KABC::AddresseeList &list ) t << "\n"; } } -#ifndef KAB_EMBEDDED -#include "csv_xxport.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_csv_xxport.cpp" #endif //KAB_EMBEDDED - - diff --git a/kaddressbook/xxport/csvimportdialog.cpp b/kaddressbook/xxport/csvimportdialog.cpp index 862241e..7959cac 100644 --- a/kaddressbook/xxport/csvimportdialog.cpp +++ b/kaddressbook/xxport/csvimportdialog.cpp @@ -26,9 +26,9 @@ Copyright (c) 2004 Ulf Schenk $Id$ */ -#include <qbuttongroup.h> +#include <q3buttongroup.h> #include <qcheckbox.h> #include <qcombobox.h> #ifdef DESKTOP_VERSION #include <qinputdialog.h> @@ -38,12 +38,16 @@ $Id$ #include <qlabel.h> #include <qlineedit.h> #include <qpushbutton.h> #include <qradiobutton.h> -#include <qtable.h> +#include <q3table.h> #include <qlayout.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qfile.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3ValueList> +#include <Q3GridLayout> #include <kapplication.h> #include <kdebug.h> #include <kdialogbase.h> @@ -55,9 +59,9 @@ $Id$ #include <kstandarddirs.h> #include <kurlrequester.h> #ifdef DESKTOP_VERSION -#include "qtable.h" +#include "q3table.h" #else #include "qcombotableitem.h" #endif #include "csvimportdialog.h" @@ -160,9 +164,9 @@ CSVImportDialog::CSVImportDialog( KABC::AddressBook *ab, QWidget *parent, connect( this, SIGNAL( user2Clicked() ), this, SLOT( saveTemplate() ) ); // if ( QApplication::desktop()->width() < 321 ) - QIconSet icon = SmallIcon("filesave"); + QIcon icon = SmallIcon("filesave"); findButton( User2 )->setIconSet (icon ) ; icon = SmallIcon("fileopen"); findButton( User1 )->setIconSet (icon ) ; @@ -185,9 +189,9 @@ KABC::AddresseeList CSVImportDialog::contacts() const KABC::Address addrHome( KABC::Address::Home ); KABC::Address addrWork( KABC::Address::Work ); for ( int col = 0; col < mTable->numCols(); ++col ) { - QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, col ) ); + Q3ComboTableItem *item = static_cast<Q3ComboTableItem*>( mTable->item( 0, col ) ); if ( !item ) { qDebug( "ERROR: item cast failed" ); continue; @@ -228,9 +232,9 @@ KABC::AddresseeList CSVImportDialog::contacts() const //the generated code had the following format: a.setBirthday( QDate::fromString( value, Qt::ISODate ) ); // But Qt::IsoDate and QDate::fromString was not specified. Do I have the wrong QT version ? { QDate dt = KGlobal::locale()->readDate( value, "%Y-%m-%d"); // = Qt::ISODate - a.setBirthday(dt); + a.setBirthday(QDateTime(dt)); } break; case Email: if ( !value.isEmpty() ) @@ -381,11 +385,11 @@ KABC::AddresseeList CSVImportDialog::contacts() const void CSVImportDialog::initGUI() { QWidget* page = plainPage(); - QGridLayout *layout = new QGridLayout( page, 1, 1, marginHintSmall(), + Q3GridLayout *layout = new Q3GridLayout( page, 1, 1, marginHintSmall(), spacingHintSmall() ); - QHBoxLayout *hbox = new QHBoxLayout(); + Q3HBoxLayout *hbox = new Q3HBoxLayout(); hbox->setSpacing( spacingHint() ); QLabel *label = new QLabel( i18n( "File to import:" ), page ); hbox->addWidget( label ); @@ -396,13 +400,13 @@ void CSVImportDialog::initGUI() layout->addMultiCellLayout( hbox, 0, 0, 0, 2 ); // Delimiter: comma, semicolon, tab, space, other - mDelimiterBox = new QButtonGroup( i18n( "Delimiter" ), page ); + mDelimiterBox = new Q3ButtonGroup( i18n( "Delimiter" ), page ); mDelimiterBox->setColumnLayout( 0, Qt::Vertical ); mDelimiterBox->layout()->setSpacing( spacingHint() ); mDelimiterBox->layout()->setMargin( marginHint() ); - QGridLayout *delimiterLayout = new QGridLayout( mDelimiterBox->layout() ); + Q3GridLayout *delimiterLayout = new Q3GridLayout( mDelimiterBox->layout() ); delimiterLayout->setAlignment( Qt::AlignTop ); layout->addMultiCellWidget( mDelimiterBox, 1, 1, 0, 2 ); mRadioComma = new QRadioButton( i18n( "Comma" ), mDelimiterBox ); @@ -449,10 +453,10 @@ void CSVImportDialog::initGUI() mIgnoreDuplicates = new QCheckBox( page ); mIgnoreDuplicates->setText( i18n( "Ignore duplicate delimiters" ) ); layout->addMultiCellWidget( mIgnoreDuplicates, 4, 4, 0, 2 ); - mTable = new QTable( 0, 0, page ); - mTable->setSelectionMode( QTable::NoSelection ); + mTable = new Q3Table( 0, 0, page ); + mTable->setSelectionMode( Q3Table::NoSelection ); //mTable->horizontalHeader()->hide(); layout->addMultiCellWidget( mTable, 5, 5, 0, 2 ); /*US setButtonText( User1, i18n( "Apply Template" ) ); @@ -482,13 +486,13 @@ void CSVImportDialog::fillTable() QChar x; QString field = ""; // store previous assignment - QValueList<int> mTypeOld = mTypeStore; + Q3ValueList<int> mTypeOld = mTypeStore; mTypeStore.clear(); for ( column = 0; column < mTable->numCols(); ++column ) { - QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, column ) ); + Q3ComboTableItem *item = static_cast<Q3ComboTableItem*>( mTable->item( 0, column ) ); if ( !item || mClearTypeStore ) mTypeStore.append( typeToPos( Undefined ) ); else if ( item ) @@ -505,16 +509,16 @@ void CSVImportDialog::fillTable() } else { mData = QString::fromLocal8Bit( mFileArray.data() ); } - QTextStream inputStream( mData, IO_ReadOnly ); + Q3TextStream inputStream( mData, QIODevice::ReadOnly ); if ( mComboCodec->currentItem () == 0 ) { - inputStream.setEncoding( QTextStream::UnicodeUTF8 ); + inputStream.setEncoding( Q3TextStream::UnicodeUTF8 ); } else if ( mComboCodec->currentItem () == 1 ) { - inputStream.setEncoding( QTextStream::Latin1 ); + inputStream.setEncoding( Q3TextStream::Latin1 ); } else { - inputStream.setEncoding( QTextStream::Locale ); + inputStream.setEncoding( Q3TextStream::Locale ); } int maxColumn = 0; while ( !inputStream.atEnd() ) { @@ -525,9 +529,9 @@ void CSVImportDialog::fillTable() switch ( state ) { case S_START : if ( x == mTextQuote ) { state = S_QUOTED_FIELD; - } else if ( x == mDelimiter ) { + } else if ( QString(x) == mDelimiter ) { if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) ) ++column; lastCharDelimiter = true; } else if ( x == '\n' ) { @@ -560,9 +564,9 @@ void CSVImportDialog::fillTable() case S_MAYBE_END_OF_QUOTED_FIELD : if ( x == mTextQuote ) { field += x; state = S_QUOTED_FIELD; - } else if ( x == mDelimiter || x == '\n' ) { + } else if ( QString(x) == mDelimiter || x == '\n' ) { setText( row - mStartLine + 1, column, field ); field = ""; if ( x == '\n' ) { ++row; @@ -577,9 +581,9 @@ void CSVImportDialog::fillTable() state = S_END_OF_QUOTED_FIELD; } break; case S_END_OF_QUOTED_FIELD : - if ( x == mDelimiter || x == '\n' ) { + if ( QString(x) == mDelimiter || x == '\n' ) { setText( row - mStartLine + 1, column, field ); field = ""; if ( x == '\n' ) { ++row; @@ -600,9 +604,9 @@ void CSVImportDialog::fillTable() state = S_QUOTED_FIELD; break; } case S_NORMAL_FIELD : - if ( x == mDelimiter || x == '\n' ) { + if ( QString(x) == mDelimiter || x == '\n' ) { setText( row - mStartLine + 1, column, field ); field = ""; if ( x == '\n' ) { ++row; @@ -616,9 +620,9 @@ void CSVImportDialog::fillTable() } else { field += x; } } - if ( x != mDelimiter ) + if ( QString(x) != mDelimiter ) lastCharDelimiter = false; if ( column > maxColumn ) maxColumn = column; @@ -648,9 +652,9 @@ void CSVImportDialog::fillTable() for ( column = 0; column < mTable->numCols(); ++column ) { //US QComboTableItem *item = new QComboTableItem( mTable, mTypeMap.keys() ); - QComboTableItem *item = new QComboTableItem( mTable, keys ); + Q3ComboTableItem *item = new Q3ComboTableItem( mTable, keys ); mTable->setItem( 0, column, item ); if ( column < mTypeStore.count() ) item->setCurrentItem( mTypeStore[ column ] ); else @@ -763,9 +767,9 @@ void CSVImportDialog::slotOk() { bool assigned = false; for ( int column = 0; column < mTable->numCols(); ++column ) { - QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, + Q3ComboTableItem *item = static_cast<Q3ComboTableItem*>( mTable->item( 0, column ) ); if ( item && posToType( item->currentItem() ) != Undefined ) assigned = true; } @@ -835,9 +839,9 @@ void CSVImportDialog::applyTemplate() // apply the column map for ( uint column = 0; column < columnMap.count(); ++column ) { int type = columnMap[ column ]; - QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, + Q3ComboTableItem *item = static_cast<Q3ComboTableItem*>( mTable->item( 0, column ) ); if ( item ) item->setCurrentItem( typeToPos( type ) ); } @@ -877,9 +881,9 @@ void CSVImportDialog::saveTemplate() config.setGroup( "csv column map" ); for ( uint column = 0; column < mTable->numCols(); ++column ) { - QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, + Q3ComboTableItem *item = static_cast<Q3ComboTableItem*>( mTable->item( 0, column ) ); if ( item ) config.writeEntry( QString::number( column ), posToType( item->currentItem() ) ); @@ -933,9 +937,9 @@ void CSVImportDialog::setFile( const QString &fileName ) if ( fileName.isEmpty() ) return; QFile file( fileName ); - if ( !file.open( IO_ReadOnly ) ) { + if ( !file.open( QIODevice::ReadOnly ) ) { KMessageBox::sorry( this, i18n( "Cannot open input file!" ) ); file.close(); return; } @@ -963,7 +967,7 @@ void CSVImportDialog::urlChanged( const QString &file ) findButton( User2 )->setEnabled( state ); } -#ifndef KAB_EMBEDDED -#include <csvimportdialog.moc> +#ifndef KAB_EMBEDDED_ +#include <moc_csvimportdialog.cpp> #endif //KAB_EMBEDDED diff --git a/kaddressbook/xxport/csvimportdialog.h b/kaddressbook/xxport/csvimportdialog.h index 2661420..520f3fa 100644 --- a/kaddressbook/xxport/csvimportdialog.h +++ b/kaddressbook/xxport/csvimportdialog.h @@ -32,19 +32,19 @@ $Id$ #include <kabc/addressbook.h> #include <kabc/addresseelist.h> #include <kdialogbase.h> -#include <qvaluelist.h> +#include <q3valuelist.h> class KURLRequester; -class QButtonGroup; +class Q3ButtonGroup; class QComboBox; class QCheckBox; class QLineEdit; class QPushButton; class QRadioButton; -class QTable; +class Q3Table; class CSVImportDialog : public KDialogBase { Q_OBJECT @@ -84,10 +84,10 @@ class CSVImportDialog : public KDialogBase HomePhone, BusinessPhone, MobilePhone, HomeFax, BusinessFax, MobileWorkPhone, Isdn, Pager, Email, Mailer, Title, Role, Organization, Note, URL, Categories }; - QTable* mTable; - QButtonGroup* mDelimiterBox; + Q3Table* mTable; + Q3ButtonGroup* mDelimiterBox; QRadioButton* mRadioComma; QRadioButton* mRadioSemicolon; QRadioButton* mRadioTab; QRadioButton* mRadioSpace; @@ -118,9 +118,9 @@ class CSVImportDialog : public KDialogBase QMap<QString, uint> mTypeMap; KABC::AddressBook *mAddressBook; int mCustomCounter; bool mClearTypeStore; - QValueList<int> mTypeStore; + Q3ValueList<int> mTypeStore; }; #endif diff --git a/kaddressbook/xxport/kde2_xxport.cpp b/kaddressbook/xxport/kde2_xxport.cpp index 03efc1b..72d3fc2 100644 --- a/kaddressbook/xxport/kde2_xxport.cpp +++ b/kaddressbook/xxport/kde2_xxport.cpp @@ -115,7 +115,7 @@ KABC::AddresseeList KDE2XXPort::importContacts( const QString& ) const return KABC::AddresseeList(); } -#ifndef KAB_EMBEDDED -#include "kde2_xxport.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_kde2_xxport.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/xxport/vcard_xxport.cpp b/kaddressbook/xxport/vcard_xxport.cpp index 9a8fa68..64b9071 100644 --- a/kaddressbook/xxport/vcard_xxport.cpp +++ b/kaddressbook/xxport/vcard_xxport.cpp @@ -28,10 +28,12 @@ $Id$ */ #include <qfile.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qfileinfo.h> +//Added by qt3to4: +#include <Q3CString> #include <kabc/vcardconverter.h> #include <kabc/vcardparser/vcardtool.h> #include <kfiledialog.h> @@ -101,16 +103,16 @@ bool VCardXXPort::exportContacts( const KABC::AddresseeList &list, const QString if ( fileName.isEmpty() ) return false; QFile outFile( fileName ); - if ( !outFile.open( IO_WriteOnly ) ) { + if ( !outFile.open( QIODevice::WriteOnly ) ) { QString text = i18n( "<qt>Unable to open file <b>%1</b> for export.</qt>" ); KMessageBox::error( parentWidget(), text.arg( fileName ) ); return false; } - QTextStream t( &outFile ); - t.setEncoding( QTextStream::UnicodeUTF8 ); + Q3TextStream t( &outFile ); + t.setEncoding( Q3TextStream::UnicodeUTF8 ); KABC::Addressee::List::ConstIterator it; for ( it = list.begin(); it != list.end(); ++it ) { KABC::VCardConverter converter; @@ -152,9 +154,9 @@ KABC::AddresseeList VCardXXPort::importContacts( const QString& ) const QString caption( i18n( "vCard Import Failed" ) ); if ( KIO::NetAccess::download( url, fileName ) ) { QFile file( fileName ); - file.open( IO_ReadOnly ); + file.open( QIODevice::ReadOnly ); QByteArray rawData = file.readAll(); file.close(); QString data = QString::fromUtf8( rawData.data(), rawData.size() + 1 ); @@ -195,10 +197,10 @@ KABC::AddresseeList VCardXXPort::importContacts( const QString& ) const return addrList; } QFile file( fileName ); - if ( file.open( IO_ReadOnly ) ) { - QCString rawData ( file.readAll().data(),file.size()+1); + if ( file.open( QIODevice::ReadOnly ) ) { + Q3CString rawData ( file.readAll().data(),file.size()+1); file.close(); int start = 0; #ifndef DESKTOP_VERSION while ( start < rawData.size()-2 ) { @@ -266,7 +268,7 @@ KABC::AddresseeList VCardXXPort::parseVCard( const QString &data ) const return addrList; } -#ifndef KAB_EMBEDDED -#include "vcard_xxport.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_vcard_xxport.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/xxportmanager.cpp b/kaddressbook/xxportmanager.cpp index 405f7ec..95b240d 100644 --- a/kaddressbook/xxportmanager.cpp +++ b/kaddressbook/xxportmanager.cpp @@ -29,8 +29,10 @@ $Id$ */ #include <qlayout.h> #include <qlist.h> +//Added by qt3to4: +#include <Q3VBoxLayout> #include <kabc/addressbook.h> #include <kabc/resource.h> #include <kdebug.h> @@ -216,20 +218,18 @@ void XXPortManager::loadPlugins() continue; } #else //KAB_EMBEDDED - QList<XXPortFactory> factorylist; + QList<XXPortFactory*> factorylist; factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_csv_xxport())); factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_kde2_xxport())); factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_vcard_xxport())); //US factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_opie_xxport())); factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_qtopia_xxport())); factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_sharpdtm_xxport())); - QListIterator<XXPortFactory> it(factorylist); - for ( ; it.current(); ++it ) - { - XXPortFactory *xxportFactory = it.current(); + for(QList<XXPortFactory*>::iterator it=factorylist.begin();it!=factorylist.end();++it) { + XXPortFactory *xxportFactory = *it; #endif //KAB_EMBEDDED XXPortObject *obj = xxportFactory->xxportObject( mCore->addressBook(), mCore ); if ( obj ) { @@ -249,9 +249,9 @@ PreviewDialog::PreviewDialog( const KABC::Addressee &addr, QWidget *parent, : KDialogBase( Plain, i18n( "Import this contact?" ), Ok | User1| User2, Ok, parent, name, true, true ,i18n( "Import all!" ),i18n( "No" ) ) { QWidget *page = plainPage(); - QVBoxLayout *layout = new QVBoxLayout( page, marginHint(), spacingHint() ); + Q3VBoxLayout *layout = new Q3VBoxLayout( page, marginHint(), spacingHint() ); connect( this, SIGNAL( user1Clicked() ), this, SLOT ( slotClose() ) ); connect( this, SIGNAL( user2Clicked() ), this, SLOT ( slotCancel() ) ); KABC::AddresseeView *view = new KABC::AddresseeView( page ); @@ -263,8 +263,7 @@ PreviewDialog::PreviewDialog( const KABC::Addressee &addr, QWidget *parent, showMaximized(); #endif } -#ifndef KAB_EMBEDDED -#include "xxportmanager.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_xxportmanager.cpp" #endif //KAB_EMBEDDED - diff --git a/kaddressbook/xxportmanager.h b/kaddressbook/xxportmanager.h index e801d9b..0528922 100644 --- a/kaddressbook/xxportmanager.h +++ b/kaddressbook/xxportmanager.h @@ -31,9 +31,9 @@ $Id$ #ifndef XXPORTMANAGER_H #define XXPORTMANAGER_H -#include <qdict.h> +#include <q3dict.h> #include <qobject.h> #include <kurl.h> @@ -70,9 +70,9 @@ class XXPortManager : public QObject private: void loadPlugins(); - QDict<XXPortObject> mXXPortObjects; + Q3Dict<XXPortObject> mXXPortObjects; KABCore *mCore; bool mShowPreview; }; diff --git a/kaddressbook/xxportobject.cpp b/kaddressbook/xxportobject.cpp index bd9d986..2d8d0ff 100644 --- a/kaddressbook/xxportobject.cpp +++ b/kaddressbook/xxportobject.cpp @@ -270,7 +270,7 @@ KABC::AddresseeList XXPortResourceObject::_importContacts( const QString& identi } -#ifndef KAB_EMBEDDED -#include "xxportobject.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_xxportobject.cpp" #endif //KAB_EMBEDDED diff --git a/kaddressbook/xxportselectdialog.cpp b/kaddressbook/xxportselectdialog.cpp index 278cab0..088bffa 100644 --- a/kaddressbook/xxportselectdialog.cpp +++ b/kaddressbook/xxportselectdialog.cpp @@ -35,18 +35,23 @@ $Id$ #include <klocale.h> #include <kglobal.h> #include <qapplication.h> -#include <qbuttongroup.h> +#include <QDesktopWidget> +#include <q3buttongroup.h> #include <qcombobox.h> -#include <qheader.h> +#include <q3header.h> #include <qlabel.h> #include <qlayout.h> -#include <qlistview.h> +#include <q3listview.h> #include <qpushbutton.h> #include <qradiobutton.h> #include <qstringlist.h> -#include <qwhatsthis.h> +#include <q3whatsthis.h> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3Frame> +#include <Q3VBoxLayout> #include "kabcore.h" #include "kabprefs.h" @@ -61,10 +66,10 @@ XXPortSelectDialog::XXPortSelectDialog( KABCore *core, bool sort, initGUI(); connect( mFiltersCombo, SIGNAL( activated( int ) ), SLOT( filterChanged( int ) ) ); - connect( mCategoriesView, SIGNAL( clicked( QListViewItem* ) ), - SLOT( categoryClicked( QListViewItem* ) ) ); + connect( mCategoriesView, SIGNAL( clicked( Q3ListViewItem* ) ), + SLOT( categoryClicked( Q3ListViewItem* ) ) ); // setup filters #ifndef KAB_EMBEDDED mFilters = Filter::restore( kapp->config(), "Filter" ); @@ -83,9 +88,9 @@ XXPortSelectDialog::XXPortSelectDialog( KABCore *core, bool sort, // setup categories QStringList categories = KABPrefs::instance()->mCustomCategories; QStringList::Iterator it; for ( it = categories.begin(); it != categories.end(); ++it ) - new QCheckListItem( mCategoriesView, *it, QCheckListItem::CheckBox ); + new Q3CheckListItem( mCategoriesView, *it, Q3CheckListItem::CheckBox ); mUseCategories->setEnabled( categories.count() > 0 ); int count = mCore->selectedUIDs().count(); mUseSelection->setEnabled( count != 0 ); @@ -209,11 +214,11 @@ KABC::AddresseeList XXPortSelectDialog::contacts() QStringList XXPortSelectDialog::categories() const { QStringList list; - QListViewItemIterator it( mCategoriesView ); + Q3ListViewItemIterator it( mCategoriesView ); for ( ; it.current(); ++it ) { - QCheckListItem* qcli = static_cast<QCheckListItem*>(it.current()); + Q3CheckListItem* qcli = static_cast<Q3CheckListItem*>(it.current()); if ( qcli->isOn() ) list.append( it.current()->text( 0 ) ); } @@ -224,11 +229,11 @@ void XXPortSelectDialog::filterChanged( int ) { mUseFilters->setChecked( true ); } -void XXPortSelectDialog::categoryClicked( QListViewItem *i ) +void XXPortSelectDialog::categoryClicked( Q3ListViewItem *i ) { - QCheckListItem *qcli = static_cast<QCheckListItem*>( i ); + Q3CheckListItem *qcli = static_cast<Q3CheckListItem*>( i ); if ( qcli->isOn() ) mUseCategories->setChecked( true ); } @@ -243,62 +248,62 @@ void XXPortSelectDialog::slotHelp() } void XXPortSelectDialog::initGUI() { - QFrame *page = plainPage(); + Q3Frame *page = plainPage(); - QVBoxLayout *topLayout = new QVBoxLayout( page, KDialog::marginHintSmall(), + Q3VBoxLayout *topLayout = new Q3VBoxLayout( page, KDialog::marginHintSmall(), KDialog::spacingHintSmall() ); QLabel *label = new QLabel( i18n( "Which contacts do you want to select?" ), page ); topLayout->addWidget( label ); - mButtonGroup = new QButtonGroup( i18n( "Contact Selection" ), page ); + mButtonGroup = new Q3ButtonGroup( i18n( "Contact Selection" ), page ); mButtonGroup->setColumnLayout( 0, Qt::Vertical ); mButtonGroup->layout()->setSpacing( KDialog::spacingHint() ); mButtonGroup->layout()->setMargin( KDialog::marginHint() ); - QGridLayout *groupLayout = new QGridLayout( mButtonGroup->layout() ); + Q3GridLayout *groupLayout = new Q3GridLayout( mButtonGroup->layout() ); groupLayout->setAlignment( Qt::AlignTop ); mUseWholeBook = new QRadioButton( i18n( "&All" ), mButtonGroup ); mUseWholeBook->setChecked( true ); - QWhatsThis::add( mUseWholeBook, i18n( "Select the entire address book" ) ); + Q3WhatsThis::add( mUseWholeBook, i18n( "Select the entire address book" ) ); groupLayout->addWidget( mUseWholeBook, 0, 0 ); mUseSelection = new QRadioButton( i18n( "&Selected" ), mButtonGroup ); - QWhatsThis::add( mUseSelection, i18n( "Only contacts selected in KAddressBook.\n" + Q3WhatsThis::add( mUseSelection, i18n( "Only contacts selected in KAddressBook.\n" "This option is disabled if no contacts are selected." ) ); groupLayout->addWidget( mUseSelection, 1, 0 ); mUseFilters = new QRadioButton( i18n( "By matching &filter" ), mButtonGroup ); - QWhatsThis::add( mUseFilters, i18n( "Only contacts matching the selected filter.\n" + Q3WhatsThis::add( mUseFilters, i18n( "Only contacts matching the selected filter.\n" "This option is disabled if you haven't defined any filters" ) ); groupLayout->addWidget( mUseFilters, 2, 0 ); mUseCategories = new QRadioButton( i18n( "By Cate&gories" ), mButtonGroup ); - QWhatsThis::add( mUseCategories, i18n( "Only contacts who are members of a category that is checked on the list to the left.\n" + Q3WhatsThis::add( mUseCategories, i18n( "Only contacts who are members of a category that is checked on the list to the left.\n" "This option is disabled if you have no categories." ) ); groupLayout->addWidget( mUseCategories, 3, 0 ); mFiltersCombo = new QComboBox( false, mButtonGroup ); mFiltersCombo->setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - QWhatsThis::add( mFiltersCombo, i18n( "Select a filter to decide which contacts to select." ) ); + Q3WhatsThis::add( mFiltersCombo, i18n( "Select a filter to decide which contacts to select." ) ); groupLayout->addWidget( mFiltersCombo, 2, 1 ); - mCategoriesView = new QListView( mButtonGroup ); + mCategoriesView = new Q3ListView( mButtonGroup ); mCategoriesView->addColumn( "" ); mCategoriesView->header()->hide(); - QWhatsThis::add( mCategoriesView, i18n( "Check the categories whose members you want to select." ) ); + Q3WhatsThis::add( mCategoriesView, i18n( "Check the categories whose members you want to select." ) ); groupLayout->addWidget( mCategoriesView, 3, 1 ); mCategoriesView->setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) ); //if (QApplication::desktop()->height() == 480 ) // mCategoriesView->setMaximumHeight( 240 ); topLayout->addWidget( mButtonGroup ); - QButtonGroup *sortingGroup = new QButtonGroup( i18n( "Sorting" ), page ); + Q3ButtonGroup *sortingGroup = new Q3ButtonGroup( i18n( "Sorting" ), page ); sortingGroup->setColumnLayout( 0, Qt::Vertical ); - QGridLayout *sortLayout = new QGridLayout( sortingGroup->layout(), 2, 2, + Q3GridLayout *sortLayout = new Q3GridLayout( sortingGroup->layout(), 2, 2, KDialog::spacingHint() ); sortLayout->setAlignment( Qt::AlignTop ); label = new QLabel( i18n( "Criterion:" ), sortingGroup ); @@ -334,9 +339,7 @@ void XXPortSelectDialog::initGUI() #endif } } -#ifndef KAB_EMBEDDED -#include "xxportselectdialog.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_xxportselectdialog.cpp" #endif //KAB_EMBEDDED - - diff --git a/kaddressbook/xxportselectdialog.h b/kaddressbook/xxportselectdialog.h index 28b1fef..208f4f9 100644 --- a/kaddressbook/xxportselectdialog.h +++ b/kaddressbook/xxportselectdialog.h @@ -29,12 +29,12 @@ #include <kdialogbase.h> #include "filter.h" -class QButtonGroup; +class Q3ButtonGroup; class QComboBox; -class QListView; -class QListViewItem; +class Q3ListView; +class Q3ListViewItem; class QRadioButton; class KABCore; class KComboBox; @@ -52,24 +52,24 @@ class XXPortSelectDialog : public KDialogBase QStringList uids(); private slots: void filterChanged( int ); - void categoryClicked( QListViewItem * i ); + void categoryClicked( Q3ListViewItem * i ); protected slots: void slotHelp(); private: void initGUI(); QStringList categories() const; - QButtonGroup* mButtonGroup; + Q3ButtonGroup* mButtonGroup; QRadioButton* mUseCategories; QRadioButton* mUseFilters; QRadioButton* mUseWholeBook; QRadioButton* mUseSelection; QComboBox* mFiltersCombo; - QListView* mCategoriesView; + Q3ListView* mCategoriesView; KComboBox *mFieldCombo; KComboBox *mSortTypeCombo; |