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/incsearchwidget.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/incsearchwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/incsearchwidget.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/kaddressbook/incsearchwidget.cpp b/kaddressbook/incsearchwidget.cpp index 5f8b83d..a54d1cd 100644 --- a/kaddressbook/incsearchwidget.cpp +++ b/kaddressbook/incsearchwidget.cpp | |||
@@ -12,55 +12,59 @@ | |||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
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 <qlabel.h> | 24 | #include <qlabel.h> |
25 | #include <qlayout.h> | 25 | #include <qlayout.h> |
26 | #include <qtooltip.h> | 26 | #include <qtooltip.h> |
27 | #include <qapplication.h> | 27 | #include <qapplication.h> |
28 | #include <QDesktopWidget> | ||
28 | #include <qcombobox.h> | 29 | #include <qcombobox.h> |
30 | //Added by qt3to4: | ||
31 | #include <Q3HBoxLayout> | ||
29 | 32 | ||
30 | #include <kdialog.h> | 33 | #include <kdialog.h> |
31 | #include <klineedit.h> | 34 | #include <klineedit.h> |
32 | #include <klocale.h> | 35 | #include <klocale.h> |
33 | #include <kglobal.h> | 36 | #include <kglobal.h> |
34 | #include <kglobal.h> | 37 | #include <kglobal.h> |
35 | #include "kabprefs.h" | 38 | #include "kabprefs.h" |
36 | 39 | ||
37 | #include "incsearchwidget.h" | 40 | #include "incsearchwidget.h" |
38 | 41 | ||
39 | IncSearchWidget::IncSearchWidget( QWidget *parent, const char *name ) | 42 | IncSearchWidget::IncSearchWidget( QWidget *parent, const char *name ) |
40 | : QWidget( parent, name ) | ||
41 | { | 43 | { |
44 | setObjectName(name); | ||
45 | setParent(parent); | ||
42 | #ifndef KAB_EMBEDDED | 46 | #ifndef KAB_EMBEDDED |
43 | //US setCaption( i18n( "Incremental Search" ) ); | 47 | //US setCaption( i18n( "Incremental Search" ) ); |
44 | #endif //KAB_EMBEDDED | 48 | #endif //KAB_EMBEDDED |
45 | 49 | ||
46 | QHBoxLayout *layout = new QHBoxLayout( this, 2, KDialog::spacingHint() ); | 50 | Q3HBoxLayout *layout = new Q3HBoxLayout( this, 2, KDialog::spacingHint() ); |
47 | 51 | ||
48 | #ifdef DESKTOP_VERSION | 52 | #ifdef DESKTOP_VERSION |
49 | QLabel *label = new QLabel( i18n( "Search:" ), this ); | 53 | QLabel *label = new QLabel( i18n( "Search:" ), this ); |
50 | label->setAlignment( QLabel::AlignVCenter | QLabel::AlignRight ); | 54 | label->setAlignment( Qt::AlignVCenter | Qt::AlignRight ); |
51 | layout->addWidget( label ); | 55 | layout->addWidget( label ); |
52 | #endif //KAB_EMBEDDED | 56 | #endif //KAB_EMBEDDED |
53 | 57 | ||
54 | mSearchText = new KLineEdit( this ); | 58 | mSearchText = new KLineEdit( this ); |
55 | layout->addWidget( mSearchText ); | 59 | layout->addWidget( mSearchText ); |
56 | // #ifdef KAB_EMBEDDED | 60 | // #ifdef KAB_EMBEDDED |
57 | // if (KGlobal::getOrientation() == KGlobal::Portrait) | 61 | // if (KGlobal::getOrientation() == KGlobal::Portrait) |
58 | // mSearchText->setMaximumWidth(30); | 62 | // mSearchText->setMaximumWidth(30); |
59 | // #endif //KAB_EMBEDDED | 63 | // #endif //KAB_EMBEDDED |
60 | //mSearchText->setMaximumWidth(60); | 64 | //mSearchText->setMaximumWidth(60); |
61 | 65 | ||
62 | 66 | ||
63 | mFieldCombo = new QComboBox( false, this ); | 67 | mFieldCombo = new QComboBox( false, this ); |
64 | layout->addWidget( mFieldCombo ); | 68 | layout->addWidget( mFieldCombo ); |
65 | mFieldCombo->setMaximumHeight( 34 ); | 69 | mFieldCombo->setMaximumHeight( 34 ); |
66 | QToolTip::add( mFieldCombo, i18n( "Select Incremental Search Field" ) ); | 70 | QToolTip::add( mFieldCombo, i18n( "Select Incremental Search Field" ) ); |
@@ -163,19 +167,19 @@ KABC::Field *IncSearchWidget::currentField()const | |||
163 | return 0; // for error or 'use all fields' | 167 | return 0; // for error or 'use all fields' |
164 | else | 168 | else |
165 | return mFieldList[ mFieldCombo->currentItem() - 1 ]; | 169 | return mFieldList[ mFieldCombo->currentItem() - 1 ]; |
166 | } | 170 | } |
167 | 171 | ||
168 | void IncSearchWidget::setCurrentItem( int pos ) | 172 | void IncSearchWidget::setCurrentItem( int pos ) |
169 | { | 173 | { |
170 | mFieldCombo->setCurrentItem( pos ); | 174 | mFieldCombo->setCurrentItem( pos ); |
171 | announceFieldChanged(); | 175 | announceFieldChanged(); |
172 | } | 176 | } |
173 | 177 | ||
174 | int IncSearchWidget::currentItem() const | 178 | int IncSearchWidget::currentItem() const |
175 | { | 179 | { |
176 | 180 | ||
177 | return mFieldCombo->currentItem(); | 181 | return mFieldCombo->currentItem(); |
178 | } | 182 | } |
179 | #ifndef KAB_EMBEDDED | 183 | #ifndef KAB_EMBEDDED_ |
180 | #include "incsearchwidget.moc" | 184 | #include "moc_incsearchwidget.cpp" |
181 | #endif //KAB_EMBEDDED | 185 | #endif //KAB_EMBEDDED |