1 | /*
|
---|
2 | * QtQuery.hpp
|
---|
3 | *
|
---|
4 | * Created on: Nov 8, 2010
|
---|
5 | * Author: heber
|
---|
6 | */
|
---|
7 |
|
---|
8 | #ifndef QTQUERY_HPP_
|
---|
9 | #define QTQUERY_HPP_
|
---|
10 |
|
---|
11 | #include "Qt4/QtDialog.hpp"
|
---|
12 |
|
---|
13 | // Forward declarations for plumbing
|
---|
14 | template<typename T> class QtQueryListPipe;
|
---|
15 | class BooleanQtQueryPipe;
|
---|
16 | class BoxQtQueryPipe;
|
---|
17 | class StringQtQueryPipe;
|
---|
18 | class StringsQtQueryPipe;
|
---|
19 | class IntQtQueryPipe;
|
---|
20 | class DoubleQtQueryPipe;
|
---|
21 | class DoublesQtQueryPipe;
|
---|
22 | class AtomQtQueryPipe;
|
---|
23 | class AtomsQtQueryPipe;
|
---|
24 | class MoleculeQtQueryPipe;
|
---|
25 | class MoleculesQtQueryPipe;
|
---|
26 | class EmptyQtQueryPipe;
|
---|
27 | class ElementQtQueryPipe;
|
---|
28 | class ElementsQtQueryPipe;
|
---|
29 | class VectorQtQueryPipe;
|
---|
30 | class VectorsQtQueryPipe;
|
---|
31 | class FileQtQueryPipe;
|
---|
32 |
|
---|
33 |
|
---|
34 | class QtDialog::AtomQtQuery : public Dialog::AtomQuery {
|
---|
35 | public:
|
---|
36 | AtomQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
|
---|
37 | virtual ~AtomQtQuery();
|
---|
38 | virtual bool handle();
|
---|
39 | private:
|
---|
40 | QBoxLayout *parent;
|
---|
41 | QBoxLayout *thisLayout;
|
---|
42 | QLabel *titleLabel;
|
---|
43 | QComboBox *inputBox;
|
---|
44 |
|
---|
45 | AtomQtQueryPipe *pipe;
|
---|
46 | };
|
---|
47 |
|
---|
48 | class QtDialog::AtomsQtQuery : public Dialog::AtomsQuery {
|
---|
49 | public:
|
---|
50 | AtomsQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
|
---|
51 | virtual ~AtomsQtQuery();
|
---|
52 | virtual bool handle();
|
---|
53 | private:
|
---|
54 | QBoxLayout *parent;
|
---|
55 | QBoxLayout *thisLayout;
|
---|
56 | QLabel *titleLabel;
|
---|
57 | QLabel *inputLabel;
|
---|
58 | QListWidget *inputList;
|
---|
59 |
|
---|
60 | AtomsQtQueryPipe *pipe;
|
---|
61 | };
|
---|
62 |
|
---|
63 | class QtDialog::BooleanQtQuery : public Dialog::BooleanQuery {
|
---|
64 | public:
|
---|
65 | BooleanQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog);
|
---|
66 | virtual ~BooleanQtQuery();
|
---|
67 | virtual bool handle();
|
---|
68 | private:
|
---|
69 | QBoxLayout *parent;
|
---|
70 | QBoxLayout *thisLayout;
|
---|
71 | QLabel *titleLabel;
|
---|
72 | QComboBox *booleanComboBox;
|
---|
73 |
|
---|
74 | BooleanQtQueryPipe *pipe;
|
---|
75 | };
|
---|
76 |
|
---|
77 | class QtDialog::BoxQtQuery : public Dialog::BoxQuery {
|
---|
78 | public:
|
---|
79 | BoxQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
|
---|
80 | virtual ~BoxQtQuery();
|
---|
81 | virtual bool handle();
|
---|
82 | private:
|
---|
83 | QBoxLayout *parent;
|
---|
84 | QBoxLayout *thisLayout;
|
---|
85 | QLabel *titleLabel;
|
---|
86 | QTableWidget *inputTable;
|
---|
87 |
|
---|
88 | BoxQtQueryPipe *pipe;
|
---|
89 | };
|
---|
90 |
|
---|
91 | class QtDialog::DoubleQtQuery : public Dialog::DoubleQuery {
|
---|
92 | public:
|
---|
93 | DoubleQtQuery(std::string title,QBoxLayout *_parent,QtDialog *_dialog);
|
---|
94 | virtual ~DoubleQtQuery();
|
---|
95 | virtual bool handle();
|
---|
96 | private:
|
---|
97 | QBoxLayout *parent;
|
---|
98 | QBoxLayout *thisLayout;
|
---|
99 | QLabel *titleLabel;
|
---|
100 | QDoubleSpinBox *inputBox;
|
---|
101 |
|
---|
102 | DoubleQtQueryPipe *pipe;
|
---|
103 | };
|
---|
104 |
|
---|
105 | class QtDialog::DoublesQtQuery : public Dialog::DoublesQuery {
|
---|
106 | public:
|
---|
107 | DoublesQtQuery(std::string title,QBoxLayout *_parent,QtDialog *_dialog);
|
---|
108 | virtual ~DoublesQtQuery();
|
---|
109 | virtual bool handle();
|
---|
110 | private:
|
---|
111 | QBoxLayout *parent;
|
---|
112 | QBoxLayout *thisLayout;
|
---|
113 | QLabel *titleLabel;
|
---|
114 | QDoubleSpinBox *inputBox;
|
---|
115 |
|
---|
116 | QtQueryListPipe<double> *pipe;
|
---|
117 | };
|
---|
118 |
|
---|
119 | class QtDialog::ElementQtQuery : public Dialog::ElementQuery {
|
---|
120 | public:
|
---|
121 | ElementQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog);
|
---|
122 | virtual ~ElementQtQuery();
|
---|
123 | virtual bool handle();
|
---|
124 | private:
|
---|
125 | QBoxLayout *parent;
|
---|
126 | QBoxLayout *thisLayout;
|
---|
127 | QLabel *titleLabel;
|
---|
128 | QComboBox *inputBox;
|
---|
129 |
|
---|
130 | ElementQtQueryPipe *pipe;
|
---|
131 | };
|
---|
132 |
|
---|
133 | class QtDialog::ElementsQtQuery : public Dialog::ElementsQuery {
|
---|
134 | public:
|
---|
135 | ElementsQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog);
|
---|
136 | virtual ~ElementsQtQuery();
|
---|
137 | virtual bool handle();
|
---|
138 | private:
|
---|
139 | QBoxLayout *parent;
|
---|
140 | QBoxLayout *thisLayout;
|
---|
141 | QLabel *titleLabel;
|
---|
142 | QComboBox *inputBox;
|
---|
143 |
|
---|
144 | ElementsQtQueryPipe *pipe;
|
---|
145 | };
|
---|
146 |
|
---|
147 | class QtDialog::EmptyQtQuery : public Dialog::EmptyQuery {
|
---|
148 | public:
|
---|
149 | EmptyQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog);
|
---|
150 | virtual ~EmptyQtQuery();
|
---|
151 | virtual bool handle();
|
---|
152 | private:
|
---|
153 | QBoxLayout *parent;
|
---|
154 | QBoxLayout *thisLayout;
|
---|
155 | QLabel *titleLabel;
|
---|
156 |
|
---|
157 | EmptyQtQueryPipe *pipe;
|
---|
158 | };
|
---|
159 |
|
---|
160 | class QtDialog::FileQtQuery : public Dialog::FileQuery {
|
---|
161 | public:
|
---|
162 | FileQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog);
|
---|
163 | virtual ~FileQtQuery();
|
---|
164 | virtual bool handle();
|
---|
165 | private:
|
---|
166 | QBoxLayout *parent;
|
---|
167 | QBoxLayout *thisLayout;
|
---|
168 | QLabel *filenameLabel;
|
---|
169 | QLineEdit *filenameLineEdit;
|
---|
170 | QPushButton *filedialogButton;
|
---|
171 |
|
---|
172 | FileQtQueryPipe *pipe;
|
---|
173 | };
|
---|
174 |
|
---|
175 | class QtDialog::IntQtQuery : public Dialog::IntQuery {
|
---|
176 | public:
|
---|
177 | IntQtQuery(std::string _title,QBoxLayout *_parent,QtDialog *_dialog);
|
---|
178 | virtual ~IntQtQuery();
|
---|
179 | virtual bool handle();
|
---|
180 | private:
|
---|
181 | QBoxLayout *parent;
|
---|
182 | QBoxLayout *thisLayout;
|
---|
183 | QLabel *titleLabel;
|
---|
184 | QSpinBox *inputBox;
|
---|
185 |
|
---|
186 | IntQtQueryPipe *pipe;
|
---|
187 | };
|
---|
188 |
|
---|
189 | class QtDialog::IntsQtQuery : public Dialog::IntsQuery {
|
---|
190 | public:
|
---|
191 | IntsQtQuery(std::string _title,QBoxLayout *_parent,QtDialog *_dialog);
|
---|
192 | virtual ~IntsQtQuery();
|
---|
193 | virtual bool handle();
|
---|
194 | void IntegerEntered(const QString&);
|
---|
195 | void IntegerSelected();
|
---|
196 | void AddInteger();
|
---|
197 | void RemoveInteger();
|
---|
198 | private:
|
---|
199 | QBoxLayout *parent;
|
---|
200 | QBoxLayout *thisLayout;
|
---|
201 | QLabel *titleLabel;
|
---|
202 |
|
---|
203 | QtQueryListPipe<int> *pipe;
|
---|
204 | };
|
---|
205 |
|
---|
206 | class QtDialog::MoleculeQtQuery : public Dialog::MoleculeQuery {
|
---|
207 | public:
|
---|
208 | MoleculeQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
|
---|
209 | virtual ~MoleculeQtQuery();
|
---|
210 | virtual bool handle();
|
---|
211 | private:
|
---|
212 | QBoxLayout *parent;
|
---|
213 | QBoxLayout *thisLayout;
|
---|
214 | QLabel *titleLabel;
|
---|
215 | QComboBox *inputBox;
|
---|
216 |
|
---|
217 | MoleculeQtQueryPipe *pipe;
|
---|
218 | };
|
---|
219 |
|
---|
220 | class QtDialog::MoleculesQtQuery : public Dialog::MoleculesQuery {
|
---|
221 | public:
|
---|
222 | MoleculesQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
|
---|
223 | virtual ~MoleculesQtQuery();
|
---|
224 | virtual bool handle();
|
---|
225 | private:
|
---|
226 | QBoxLayout *parent;
|
---|
227 | QBoxLayout *thisLayout;
|
---|
228 | QLabel *titleLabel;
|
---|
229 | QComboBox *inputBox;
|
---|
230 |
|
---|
231 | MoleculesQtQueryPipe *pipe;
|
---|
232 | };
|
---|
233 |
|
---|
234 | class QtDialog::StringQtQuery : public Dialog::StringQuery {
|
---|
235 | public:
|
---|
236 | StringQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
|
---|
237 | virtual ~StringQtQuery();
|
---|
238 | virtual bool handle();
|
---|
239 | private:
|
---|
240 | QBoxLayout *parent;
|
---|
241 | QBoxLayout *thisLayout;
|
---|
242 | QLabel *titleLabel;
|
---|
243 | QLineEdit *inputBox;
|
---|
244 |
|
---|
245 | StringQtQueryPipe *pipe;
|
---|
246 | };
|
---|
247 |
|
---|
248 | class QtDialog::StringsQtQuery : public Dialog::StringsQuery {
|
---|
249 | public:
|
---|
250 | StringsQtQuery(std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
|
---|
251 | virtual ~StringsQtQuery();
|
---|
252 | virtual bool handle();
|
---|
253 | private:
|
---|
254 | QBoxLayout *parent;
|
---|
255 | QBoxLayout *thisLayout;
|
---|
256 | QLabel *titleLabel;
|
---|
257 | QLineEdit *inputBox;
|
---|
258 |
|
---|
259 | QtQueryListPipe<std::string> *pipe;
|
---|
260 | };
|
---|
261 |
|
---|
262 | class QtDialog::VectorQtQuery : public Dialog::VectorQuery {
|
---|
263 | public:
|
---|
264 | VectorQtQuery(std::string title,bool _check,QBoxLayout *,QtDialog *);
|
---|
265 | virtual ~VectorQtQuery();
|
---|
266 | virtual bool handle();
|
---|
267 | private:
|
---|
268 | QBoxLayout *parent;
|
---|
269 | QBoxLayout *mainLayout;
|
---|
270 | QLabel *titleLabel;
|
---|
271 | QBoxLayout *subLayout;
|
---|
272 | QBoxLayout *coordLayout;
|
---|
273 | QLabel *coordLabel;
|
---|
274 | QDoubleSpinBox *coordInput;
|
---|
275 |
|
---|
276 | VectorQtQueryPipe *pipe;
|
---|
277 | };
|
---|
278 |
|
---|
279 | class QtDialog::VectorsQtQuery : public Dialog::VectorsQuery {
|
---|
280 | public:
|
---|
281 | VectorsQtQuery(std::string title,bool _check,QBoxLayout *,QtDialog *);
|
---|
282 | virtual ~VectorsQtQuery();
|
---|
283 | virtual bool handle();
|
---|
284 | private:
|
---|
285 | QBoxLayout *parent;
|
---|
286 | QBoxLayout *mainLayout;
|
---|
287 | QLabel *titleLabel;
|
---|
288 | QBoxLayout *subLayout;
|
---|
289 | QBoxLayout *coordLayout;
|
---|
290 | QLabel *coordLabel;
|
---|
291 | QDoubleSpinBox *coordInput;
|
---|
292 |
|
---|
293 | VectorsQtQueryPipe *pipe;
|
---|
294 | };
|
---|
295 |
|
---|
296 | #endif /* QTQUERY_HPP_ */
|
---|