summaryrefslogtreecommitdiff
path: root/noncore/apps/tableviewer/ui/filterkeyentry.cpp
Unidiff
Diffstat (limited to 'noncore/apps/tableviewer/ui/filterkeyentry.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/tableviewer/ui/filterkeyentry.cpp42
1 files changed, 23 insertions, 19 deletions
diff --git a/noncore/apps/tableviewer/ui/filterkeyentry.cpp b/noncore/apps/tableviewer/ui/filterkeyentry.cpp
index d108fbd..4d74d6b 100644
--- a/noncore/apps/tableviewer/ui/filterkeyentry.cpp
+++ b/noncore/apps/tableviewer/ui/filterkeyentry.cpp
@@ -13,16 +13,21 @@
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 "filterkeyentry.h" 20#include "filterkeyentry.h"
21#include "commonwidgets.h" 21#include "commonwidgets.h"
22 22
23/* OPIE */
24#include <opie2/odebug.h>
25using namespace Opie::Core;
26
27/* QT */
23#include <qwidgetstack.h> 28#include <qwidgetstack.h>
24#include <qcombobox.h> 29#include <qcombobox.h>
25#include <qlayout.h> 30#include <qlayout.h>
26#include <qlineedit.h> 31#include <qlineedit.h>
27#include <qsizepolicy.h> 32#include <qsizepolicy.h>
28#include <qdatetime.h> 33#include <qdatetime.h>
@@ -95,19 +100,19 @@ TVFilterKeyEntry::TVFilterKeyEntry(QWidget *parent, const char *name, WFlags f)
95 ws->addWidget(textEntry, TVVariant::String); 100 ws->addWidget(textEntry, TVVariant::String);
96 ws->addWidget(intEntry, TVVariant::Int); 101 ws->addWidget(intEntry, TVVariant::Int);
97 ws->addWidget(timeEntry, TVVariant::Time); 102 ws->addWidget(timeEntry, TVVariant::Time);
98 ws->addWidget(dateEntry, TVVariant::Date); 103 ws->addWidget(dateEntry, TVVariant::Date);
99 104
100 /* connect the signals down */ 105 /* connect the signals down */
101 connect(textKey, SIGNAL(textChanged(const QString&)), 106 connect(textKey, SIGNAL(textChanged(const QString&)),
102 this, SIGNAL(valueChanged())); 107 this, SIGNAL(valueChanged()));
103 connect(intKey, SIGNAL(valueChanged(int)), 108 connect(intKey, SIGNAL(valueChanged(int)),
104 this, SIGNAL(valueChanged())); 109 this, SIGNAL(valueChanged()));
105 connect(dateKey, SIGNAL(valueChanged(const QDate&)), 110 connect(dateKey, SIGNAL(valueChanged(const QDate&)),
106 this, SIGNAL(valueChanged())); 111 this, SIGNAL(valueChanged()));
107 connect(timeKey, SIGNAL(valueChanged(const QTime&)), 112 connect(timeKey, SIGNAL(valueChanged(const QTime&)),
108 this, SIGNAL(valueChanged())); 113 this, SIGNAL(valueChanged()));
109 114
110 connect(intCombo, SIGNAL(activated(int)), this, SIGNAL(valueChanged())); 115 connect(intCombo, SIGNAL(activated(int)), this, SIGNAL(valueChanged()));
111 connect(textCombo, SIGNAL(activated(int)), this, SIGNAL(valueChanged())); 116 connect(textCombo, SIGNAL(activated(int)), this, SIGNAL(valueChanged()));
112 connect(timeCombo, SIGNAL(activated(int)), this, SIGNAL(valueChanged())); 117 connect(timeCombo, SIGNAL(activated(int)), this, SIGNAL(valueChanged()));
113 connect(dateCombo, SIGNAL(activated(int)), this, SIGNAL(valueChanged())); 118 connect(dateCombo, SIGNAL(activated(int)), this, SIGNAL(valueChanged()));
@@ -116,19 +121,19 @@ TVFilterKeyEntry::TVFilterKeyEntry(QWidget *parent, const char *name, WFlags f)
116 layout->addWidget(ws); 121 layout->addWidget(ws);
117 122
118 current_type = TVVariant::String; 123 current_type = TVVariant::String;
119} 124}
120 125
121/*! 126/*!
122 Destructs the widget 127 Destructs the widget
123*/ 128*/
124TVFilterKeyEntry::~TVFilterKeyEntry() 129TVFilterKeyEntry::~TVFilterKeyEntry()
125{ 130{
126} 131}
127 132
128void TVFilterKeyEntry::setKey(int i) 133void TVFilterKeyEntry::setKey(int i)
129{ 134{
130 135
131 if (!ts) return; 136 if (!ts) return;
132 if (!ts->kRep) return; 137 if (!ts->kRep) return;
133 138
134 /* set up to raise appropriate widget set */ 139 /* set up to raise appropriate widget set */
@@ -180,29 +185,28 @@ CmpType TVFilterKeyEntry::getCompareType()
180TVVariant TVFilterKeyEntry::getCompareValue() 185TVVariant TVFilterKeyEntry::getCompareValue()
181{ 186{
182 TVVariant sendkey; 187 TVVariant sendkey;
183 int tmp; 188 int tmp;
184 189
185 switch(current_type) { 190 switch(current_type) {
186 case TVVariant::String: 191 case TVVariant::String:
187 sendkey = TVVariant(QString(textKey->text())); 192 sendkey = TVVariant(QString(textKey->text()));
188 break; 193 break;
189 case TVVariant::Int: { 194 case TVVariant::Int: {
190 sendkey = TVVariant(intKey->value()); 195 sendkey = TVVariant(intKey->value());
191 break; 196 break;
192 } 197 }
193 case TVVariant::Time: { 198 case TVVariant::Time: {
194 sendkey = TVVariant(QTime(timeKey->time())); 199 sendkey = TVVariant(QTime(timeKey->time()));
195 break; 200 break;
196 } 201 }
197 case TVVariant::Date: { 202 case TVVariant::Date: {
198 sendkey = TVVariant(QDate(dateKey->date())); 203 sendkey = TVVariant(QDate(dateKey->date()));
199 break; 204 break;
200 } 205 }
201 default: { 206 default: {
202 sendkey = TVVariant(0); 207 sendkey = TVVariant(0);
203 qWarning("TVFilterKeyEntry::getCompareValue() " 208 owarn << "TVFilterKeyEntry::getCompareValue() cannot work out data type" << oendl;
204 "cannot work out data type");
205 } 209 }
206 } 210 }
207 return sendkey; 211 return sendkey;
208} 212}