Diffstat (limited to 'kaddressbook/phoneeditwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/phoneeditwidget.cpp | 60 |
1 files changed, 33 insertions, 27 deletions
diff --git a/kaddressbook/phoneeditwidget.cpp b/kaddressbook/phoneeditwidget.cpp index df3b551..3661677 100644 --- a/kaddressbook/phoneeditwidget.cpp +++ b/kaddressbook/phoneeditwidget.cpp @@ -27,13 +27,19 @@ #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> @@ -57,7 +63,7 @@ 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 ); @@ -67,14 +73,14 @@ PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name ) 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 ); @@ -90,7 +96,7 @@ PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name ) } setDefaults(); mTypeNumberEditList.setAutoDelete( true ); - mPopup = new QPopupMenu( this ); + mPopup = new Q3PopupMenu( this ); QStringList list = PhoneNumber::supportedTypeListNames(); mPopupCount = list.count(); int i = 0; @@ -226,7 +232,7 @@ KABC::PhoneNumber::List PhoneEditWidget::phoneNumbers() 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() ); @@ -236,7 +242,7 @@ PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name ) //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 ); @@ -327,7 +333,7 @@ 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; @@ -337,7 +343,7 @@ 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 ) ); @@ -487,10 +493,10 @@ 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 ) { @@ -511,8 +517,8 @@ 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 ); @@ -544,7 +550,7 @@ PhoneEditDialog::PhoneEditDialog( const KABC::PhoneNumber::List &list, QWidget * QWidget *page = plainPage(); - QGridLayout *layout = new QGridLayout( page, 1, 2 ); + Q3GridLayout *layout = new Q3GridLayout( page, 1, 2 ); layout->setSpacing( spacingHint() ); mListView = new KListView( page ); @@ -552,7 +558,7 @@ PhoneEditDialog::PhoneEditDialog( const KABC::PhoneNumber::List &list, QWidget * 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() ) ); @@ -565,7 +571,7 @@ PhoneEditDialog::PhoneEditDialog( const KABC::PhoneNumber::List &list, QWidget * 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 ) @@ -588,7 +594,7 @@ void PhoneEditDialog::slotAddPhoneNumber() 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 ) { @@ -620,7 +626,7 @@ void PhoneEditDialog::slotRemovePhoneNumber() return; mPhoneNumberList.remove( item->phoneNumber() ); - QListViewItem *currItem = mListView->currentItem(); + Q3ListViewItem *currItem = mListView->currentItem(); mListView->takeItem( currItem ); delete currItem; @@ -673,7 +679,7 @@ PhoneTypeDialog::PhoneTypeDialog( const KABC::PhoneNumber &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 ); @@ -683,7 +689,7 @@ 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 @@ -726,6 +732,6 @@ KABC::PhoneNumber PhoneTypeDialog::phoneNumber() return mPhoneNumber; } #endif -#ifndef KAB_EMBEDDED -#include "phoneeditwidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_phoneeditwidget.cpp" #endif //KAB_EMBEDDED |