summaryrefslogtreecommitdiff
path: root/noncore/apps/tableviewer/ui/browsekeyentry.cpp
Unidiff
Diffstat (limited to 'noncore/apps/tableviewer/ui/browsekeyentry.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/tableviewer/ui/browsekeyentry.cpp49
1 files changed, 24 insertions, 25 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
@@ -16,10 +16,13 @@
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>
24using 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>
@@ -29,9 +32,6 @@
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
@@ -42,7 +42,7 @@
42*/ 42*/
43 43
44/*! 44/*!
45 Constructs the widget 45 Constructs the widget
46*/ 46*/
47TVBrowseKeyEntry::TVBrowseKeyEntry(QWidget *parent, const char *name, WFlags f) 47TVBrowseKeyEntry::TVBrowseKeyEntry(QWidget *parent, const char *name, WFlags f)
48 : QWidget(parent, name, f) 48 : QWidget(parent, name, f)
@@ -73,36 +73,36 @@ TVBrowseKeyEntry::TVBrowseKeyEntry(QWidget *parent, const char *name, WFlags f)
73 ws->addWidget(dateKey, TVVariant::Date); 73 ws->addWidget(dateKey, TVVariant::Date);
74 74
75 ws->raiseWidget(TVVariant::String); 75 ws->raiseWidget(TVVariant::String);
76 76
77 // TODO connect slots and signals.... 77 // TODO connect slots and signals....
78 connect(changeKeyButton, SIGNAL(clicked()), 78 connect(changeKeyButton, SIGNAL(clicked()),
79 this, SLOT(changeKeyMenuSlot())); 79 this, SLOT(changeKeyMenuSlot()));
80 80
81 connect(resetButton, SIGNAL(clicked()), 81 connect(resetButton, SIGNAL(clicked()),
82 textKey, SLOT(clear())); 82 textKey, SLOT(clear()));
83 connect(resetButton, SIGNAL(clicked()), 83 connect(resetButton, SIGNAL(clicked()),
84 intKey, SLOT(clear())); 84 intKey, SLOT(clear()));
85 connect(resetButton, SIGNAL(clicked()), 85 connect(resetButton, SIGNAL(clicked()),
86 dateKey, SLOT(clear())); 86 dateKey, SLOT(clear()));
87 connect(resetButton, SIGNAL(clicked()), 87 connect(resetButton, SIGNAL(clicked()),
88 timeKey, SLOT(clear())); 88 timeKey, SLOT(clear()));
89 89
90 h_layout->addWidget(ws); 90 h_layout->addWidget(ws);
91 h_layout->addWidget(resetButton); 91 h_layout->addWidget(resetButton);
92 h_layout->addWidget(changeKeyButton); 92 h_layout->addWidget(changeKeyButton);
93 93
94 connect(textKey, SIGNAL(textChanged(const QString&)), 94 connect(textKey, SIGNAL(textChanged(const QString&)),
95 this, SLOT(searchOnText())); 95 this, SLOT(searchOnText()));
96 connect(intKey, SIGNAL(valueChanged(int)), 96 connect(intKey, SIGNAL(valueChanged(int)),
97 this, SLOT(searchOnText())); 97 this, SLOT(searchOnText()));
98 connect(dateKey, SIGNAL(valueChanged(const QDate&)), 98 connect(dateKey, SIGNAL(valueChanged(const QDate&)),
99 this, SLOT(searchOnText())); 99 this, SLOT(searchOnText()));
100 connect(timeKey, SIGNAL(valueChanged(const QTime&)), 100 connect(timeKey, SIGNAL(valueChanged(const QTime&)),
101 this, SLOT(searchOnText())); 101 this, SLOT(searchOnText()));
102} 102}
103 103
104/*! 104/*!
105 Destructs the widget 105 Destructs the widget
106*/ 106*/
107TVBrowseKeyEntry::~TVBrowseKeyEntry() 107TVBrowseKeyEntry::~TVBrowseKeyEntry()
108{ 108{
@@ -126,7 +126,7 @@ void TVBrowseKeyEntry::changeKeySlot(int id_param)
126*/ 126*/
127void TVBrowseKeyEntry::changeKeyMenuSlot() 127void TVBrowseKeyEntry::changeKeyMenuSlot()
128{ 128{
129 if(ts) 129 if(ts)
130 keyMenu->exec(changeKeyButton->mapToGlobal(QPoint(0,0))); 130 keyMenu->exec(changeKeyButton->mapToGlobal(QPoint(0,0)));
131} 131}
132 132
@@ -146,7 +146,7 @@ void TVBrowseKeyEntry::rebuildKeys() {
146 KeyListIterator it(*ts->kRep); 146 KeyListIterator it(*ts->kRep);
147 147
148 for (i = 0; i < ts->kRep->getNumFields(); i++) { 148 for (i = 0; i < ts->kRep->getNumFields(); i++) {
149 keyMenu->insertItem(it.current()->name(), this, 149 keyMenu->insertItem(it.current()->name(), this,
150 SLOT(changeKeySlot(int)), 0, i); 150 SLOT(changeKeySlot(int)), 0, i);
151 keyMenu->setItemParameter(i, it.currentKey()); 151 keyMenu->setItemParameter(i, it.currentKey());
152 ++it; 152 ++it;
@@ -163,8 +163,8 @@ void TVBrowseKeyEntry::reset()
163 keyMenu->clear(); 163 keyMenu->clear();
164} 164}
165/*! 165/*!
166 Searches on the current value of the key entry provided that the 166 Searches on the current value of the key entry provided that the
167 current key is of type text WARNING, TODO fix memory leaks 167 current key is of type text WARNING, TODO fix memory leaks
168*/ 168*/
169void TVBrowseKeyEntry::searchOnText() 169void TVBrowseKeyEntry::searchOnText()
170{ 170{
@@ -189,11 +189,10 @@ void TVBrowseKeyEntry::searchOnText()
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);
@@ -203,4 +202,4 @@ void TVBrowseKeyEntry::searchOnText()
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*/