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) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kaddressbook/kcmconfigs/addresseewidget.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
Diffstat (limited to 'kaddressbook/kcmconfigs/addresseewidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/kcmconfigs/addresseewidget.cpp | 36 |
1 files changed, 20 insertions, 16 deletions
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 | |||
@@ -21,12 +21,16 @@ | |||
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qgroupbox.h> | 24 | #include <q3groupbox.h> |
25 | #include <qlabel.h> | 25 | #include <qlabel.h> |
26 | #include <qlayout.h> | 26 | #include <qlayout.h> |
27 | #include <qlistbox.h> | 27 | #include <q3listbox.h> |
28 | #include <qpushbutton.h> | 28 | #include <qpushbutton.h> |
29 | #include <qapplication.h> | 29 | #include <qapplication.h> |
30 | #include <QDesktopWidget> | ||
31 | //Added by qt3to4: | ||
32 | #include <Q3GridLayout> | ||
33 | #include <Q3HBoxLayout> | ||
30 | 34 | ||
31 | #include <kbuttonbox.h> | 35 | #include <kbuttonbox.h> |
32 | #include <kcombobox.h> | 36 | #include <kcombobox.h> |
@@ -45,13 +49,13 @@ NamePartWidget::NamePartWidget( const QString &title, QWidget *parent, | |||
45 | { | 49 | { |
46 | if (KGlobal::getOrientation() == KGlobal::Portrait) | 50 | if (KGlobal::getOrientation() == KGlobal::Portrait) |
47 | { | 51 | { |
48 | QGridLayout* layout = new QGridLayout( this, 1, 1, KDialog::marginHintSmall(), | 52 | Q3GridLayout* layout = new Q3GridLayout( this, 1, 1, KDialog::marginHintSmall(), |
49 | KDialog::spacingHintSmall() ); | 53 | KDialog::spacingHintSmall() ); |
50 | 54 | ||
51 | QLabel *label = new QLabel( i18n( title ), this ); | 55 | QLabel *label = new QLabel( i18n( title ), this ); |
52 | layout->addWidget( label, 0, 1 ); | 56 | layout->addWidget( label, 0, 1 ); |
53 | 57 | ||
54 | mBox = new QListBox( this ); | 58 | mBox = new Q3ListBox( this ); |
55 | mBox->setMaximumSize(70, 70); | 59 | mBox->setMaximumSize(70, 70); |
56 | layout->addMultiCellWidget( mBox, 0, 1, 0, 0 ); | 60 | layout->addMultiCellWidget( mBox, 0, 1, 0, 0 ); |
57 | 61 | ||
@@ -70,13 +74,13 @@ NamePartWidget::NamePartWidget( const QString &title, QWidget *parent, | |||
70 | } | 74 | } |
71 | else | 75 | else |
72 | { | 76 | { |
73 | QHBoxLayout *layout = new QHBoxLayout( this ); | 77 | Q3HBoxLayout *layout = new Q3HBoxLayout( this ); |
74 | 78 | ||
75 | QGroupBox *group = new QGroupBox( 0, Qt::Vertical, title, this ); | 79 | Q3GroupBox *group = new Q3GroupBox( 0, Qt::Vertical, title, this ); |
76 | QGridLayout *groupLayout = new QGridLayout( group->layout(), 2, 2, | 80 | Q3GridLayout *groupLayout = new Q3GridLayout( group->layout(), 2, 2, |
77 | KDialog::spacingHint() ); | 81 | KDialog::spacingHint() ); |
78 | 82 | ||
79 | mBox = new QListBox( group ); | 83 | mBox = new Q3ListBox( group ); |
80 | 84 | ||
81 | groupLayout->addWidget( mBox, 0, 0 ); | 85 | groupLayout->addWidget( mBox, 0, 0 ); |
82 | 86 | ||
@@ -97,8 +101,8 @@ NamePartWidget::NamePartWidget( const QString &title, QWidget *parent, | |||
97 | mRemoveButton->setEnabled( false ); | 101 | mRemoveButton->setEnabled( false ); |
98 | 102 | ||
99 | 103 | ||
100 | connect( mBox, SIGNAL( selectionChanged( QListBoxItem* ) ), | 104 | connect( mBox, SIGNAL( selectionChanged( Q3ListBoxItem* ) ), |
101 | SLOT( selectionChanged( QListBoxItem* ) ) ); | 105 | SLOT( selectionChanged( Q3ListBoxItem* ) ) ); |
102 | connect( mEdit, SIGNAL( textChanged( const QString& ) ), | 106 | connect( mEdit, SIGNAL( textChanged( const QString& ) ), |
103 | SLOT( textChanged( const QString& ) ) ); | 107 | SLOT( textChanged( const QString& ) ) ); |
104 | connect( mEdit, SIGNAL( returnPressed() ), SLOT( add() ) ); | 108 | connect( mEdit, SIGNAL( returnPressed() ), SLOT( add() ) ); |
@@ -143,7 +147,7 @@ void NamePartWidget::remove() | |||
143 | emit modified(); | 147 | emit modified(); |
144 | } | 148 | } |
145 | 149 | ||
146 | void NamePartWidget::selectionChanged( QListBoxItem *item ) | 150 | void NamePartWidget::selectionChanged( Q3ListBoxItem *item ) |
147 | { | 151 | { |
148 | mRemoveButton->setEnabled( item != 0 ); | 152 | mRemoveButton->setEnabled( item != 0 ); |
149 | } | 153 | } |
@@ -157,7 +161,7 @@ void NamePartWidget::textChanged( const QString& text ) | |||
157 | AddresseeWidget::AddresseeWidget( QWidget *parent, const char *name ) | 161 | AddresseeWidget::AddresseeWidget( QWidget *parent, const char *name ) |
158 | : QWidget( parent, name ) | 162 | : QWidget( parent, name ) |
159 | { | 163 | { |
160 | QGridLayout *layout; | 164 | Q3GridLayout *layout; |
161 | 165 | ||
162 | mPrefix = new NamePartWidget( i18n( "Prefixes" ), this ); | 166 | mPrefix = new NamePartWidget( i18n( "Prefixes" ), this ); |
163 | mInclusion = new NamePartWidget( i18n( "Inclusions" ), this ); | 167 | mInclusion = new NamePartWidget( i18n( "Inclusions" ), this ); |
@@ -178,7 +182,7 @@ AddresseeWidget::AddresseeWidget( QWidget *parent, const char *name ) | |||
178 | 182 | ||
179 | if (KGlobal::getOrientation() == KGlobal::Portrait) | 183 | if (KGlobal::getOrientation() == KGlobal::Portrait) |
180 | { | 184 | { |
181 | layout = new QGridLayout( this, 4, 2, KDialog::marginHintSmall(), | 185 | layout = new Q3GridLayout( this, 4, 2, KDialog::marginHintSmall(), |
182 | KDialog::spacingHintSmall() ); | 186 | KDialog::spacingHintSmall() ); |
183 | 187 | ||
184 | layout->addMultiCellWidget( mPrefix, 0, 0, 0, 1 ); | 188 | layout->addMultiCellWidget( mPrefix, 0, 0, 0, 1 ); |
@@ -190,7 +194,7 @@ AddresseeWidget::AddresseeWidget( QWidget *parent, const char *name ) | |||
190 | } | 194 | } |
191 | else | 195 | else |
192 | { | 196 | { |
193 | layout = new QGridLayout( this, 2, 3, KDialog::marginHint(), | 197 | layout = new Q3GridLayout( this, 2, 3, KDialog::marginHint(), |
194 | KDialog::spacingHint() ); | 198 | KDialog::spacingHint() ); |
195 | 199 | ||
196 | layout->addWidget( mPrefix, 0, 0 ); | 200 | layout->addWidget( mPrefix, 0, 0 ); |
@@ -233,6 +237,6 @@ void AddresseeWidget::saveSettings() | |||
233 | config.writeEntry( "FormattedNameType", mFormattedNameCombo->currentItem() ); | 237 | config.writeEntry( "FormattedNameType", mFormattedNameCombo->currentItem() ); |
234 | } | 238 | } |
235 | 239 | ||
236 | #ifndef KAB_EMBEDDED | 240 | #ifndef KAB_EMBEDDED_ |
237 | #include "addresseewidget.moc" | 241 | #include "moc_addresseewidget.cpp" |
238 | #endif //KAB_EMBEDDED | 242 | #endif //KAB_EMBEDDED |