Diffstat (limited to 'noncore/apps/tableviewer/ui/browsekeyentry.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/tableviewer/ui/browsekeyentry.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/noncore/apps/tableviewer/ui/browsekeyentry.cpp b/noncore/apps/tableviewer/ui/browsekeyentry.cpp index 42e24dd..6b78437 100644 --- a/noncore/apps/tableviewer/ui/browsekeyentry.cpp +++ b/noncore/apps/tableviewer/ui/browsekeyentry.cpp | |||
@@ -1,58 +1,58 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include "browsekeyentry.h" | 20 | #include "browsekeyentry.h" |
21 | #include "commonwidgets.h" | 21 | #include "commonwidgets.h" |
22 | 22 | ||
23 | #include <opie2/odebug.h> | ||
24 | using namespace Opie::Core; | ||
25 | |||
23 | #include <qtoolbutton.h> | 26 | #include <qtoolbutton.h> |
24 | #include <qwidgetstack.h> | 27 | #include <qwidgetstack.h> |
25 | #include <qlayout.h> | 28 | #include <qlayout.h> |
26 | #include <qlineedit.h> | 29 | #include <qlineedit.h> |
27 | #include <qpushbutton.h> | 30 | #include <qpushbutton.h> |
28 | #include <qpopupmenu.h> | 31 | #include <qpopupmenu.h> |
29 | #include <qhbox.h> | 32 | #include <qhbox.h> |
30 | #include <qdatetime.h> | 33 | #include <qdatetime.h> |
31 | 34 | ||
32 | #include <qheader.h> | ||
33 | // For qWarning(const char *) | ||
34 | |||
35 | /*! | 35 | /*! |
36 | \class TVBrowseKeyEntry | 36 | \class TVBrowseKeyEntry |
37 | \brief a Widget used enter keys into the TVBrowseViewWidget | 37 | \brief a Widget used enter keys into the TVBrowseViewWidget |
38 | 38 | ||
39 | The TVBrowseKeyEntry Widget provides the facility to enter | 39 | The TVBrowseKeyEntry Widget provides the facility to enter |
40 | various key types to be search on in the table. The key can be changed | 40 | various key types to be search on in the table. The key can be changed |
41 | and the entry field will update to the correct sort of widget appropriately | 41 | and the entry field will update to the correct sort of widget appropriately |
42 | */ | 42 | */ |
43 | 43 | ||
44 | /*! | 44 | /*! |
45 | Constructs the widget | 45 | Constructs the widget |
46 | */ | 46 | */ |
47 | TVBrowseKeyEntry::TVBrowseKeyEntry(QWidget *parent, const char *name, WFlags f) | 47 | TVBrowseKeyEntry::TVBrowseKeyEntry(QWidget *parent, const char *name, WFlags f) |
48 | : QWidget(parent, name, f) | 48 | : QWidget(parent, name, f) |
49 | { | 49 | { |
50 | QHBoxLayout *h_layout = new QHBoxLayout(this); | 50 | QHBoxLayout *h_layout = new QHBoxLayout(this); |
51 | 51 | ||
52 | textKey = new QLineEdit(this, 0); | 52 | textKey = new QLineEdit(this, 0); |
53 | intKey = new IntEdit(this, 0); | 53 | intKey = new IntEdit(this, 0); |
54 | dateKey = new DateEdit(this, 0); | 54 | dateKey = new DateEdit(this, 0); |
55 | timeKey = new TimeEdit(this, 0); | 55 | timeKey = new TimeEdit(this, 0); |
56 | 56 | ||
57 | resetButton = new QPushButton(this, "reset"); | 57 | resetButton = new QPushButton(this, "reset"); |
58 | resetButton->setMinimumSize(QSize(50, 0)); | 58 | resetButton->setMinimumSize(QSize(50, 0)); |
@@ -171,36 +171,35 @@ void TVBrowseKeyEntry::searchOnText() | |||
171 | TVVariant sendkey; | 171 | TVVariant sendkey; |
172 | 172 | ||
173 | if (!ts) | 173 | if (!ts) |
174 | return; | 174 | return; |
175 | 175 | ||
176 | switch(ts->kRep->getKeyType(ts->current_column)) { | 176 | switch(ts->kRep->getKeyType(ts->current_column)) { |
177 | case TVVariant::String: | 177 | case TVVariant::String: |
178 | sendkey = TVVariant(QString(textKey->text())); | 178 | sendkey = TVVariant(QString(textKey->text())); |
179 | break; | 179 | break; |
180 | case TVVariant::Int: { | 180 | case TVVariant::Int: { |
181 | sendkey = TVVariant(intKey->value()); | 181 | sendkey = TVVariant(intKey->value()); |
182 | break; | 182 | break; |
183 | } | 183 | } |
184 | case TVVariant::Time: { | 184 | case TVVariant::Time: { |
185 | sendkey = TVVariant(QTime(timeKey->time())); | 185 | sendkey = TVVariant(QTime(timeKey->time())); |
186 | break; | 186 | break; |
187 | } | 187 | } |
188 | case TVVariant::Date: { | 188 | case TVVariant::Date: { |
189 | sendkey = TVVariant(QDate(dateKey->date())); | 189 | sendkey = TVVariant(QDate(dateKey->date())); |
190 | break; | 190 | break; |
191 | } | 191 | } |
192 | case TVVariant::Invalid: | 192 | case TVVariant::Invalid: |
193 | break; | 193 | break; |
194 | default: | 194 | default: |
195 | qWarning("TVBrowseKeyEntry::searchOnText() " | 195 | owarn << "TVBrowseKeyEntry::searchOnText() cannot work out data type" << oendl; |
196 | "cannot work out data type"); | ||
197 | return; | 196 | return; |
198 | } | 197 | } |
199 | emit searchOnKey(ts->current_column, sendkey); | 198 | emit searchOnKey(ts->current_column, sendkey); |
200 | } | 199 | } |
201 | 200 | ||
202 | /*! \fn void TVBrowseKeyEntry::searchOnKey(int currentKeyId, TVVariant) | 201 | /*! \fn void TVBrowseKeyEntry::searchOnKey(int currentKeyId, TVVariant) |
203 | 202 | ||
204 | This signal indicates that a search on key index currentKeyId should be | 203 | This signal indicates that a search on key index currentKeyId should be |
205 | done searching for the value v. | 204 | done searching for the value v. |
206 | */ | 205 | */ |