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 config.h
|
---|
12 | #ifdef HAVE_CONFIG_H
|
---|
13 | #include <config.h>
|
---|
14 | #endif
|
---|
15 |
|
---|
16 |
|
---|
17 | #include <Qt/qwidget.h>
|
---|
18 | #include "Qt4/QtDialog.hpp"
|
---|
19 | #include "Parameters/Parameter.hpp"
|
---|
20 |
|
---|
21 | class QHBoxLayout;
|
---|
22 | class QBoxLayout;
|
---|
23 | class QDialogButtonBox;
|
---|
24 | class QLabel;
|
---|
25 | class QSpinBox;
|
---|
26 | class QDoubleSpinBox;
|
---|
27 | class QLineEdit;
|
---|
28 | class QListWidget;
|
---|
29 | class QPushButton;
|
---|
30 | class QTableWidget;
|
---|
31 | class QTextEdit;
|
---|
32 | class QComboBox;
|
---|
33 | class QCheckBox;
|
---|
34 | class QFileDialog;
|
---|
35 |
|
---|
36 | class QtDialog::AtomQtQuery : public QWidget, public Dialog::AtomQuery {
|
---|
37 | Q_OBJECT
|
---|
38 | public:
|
---|
39 | AtomQtQuery(Parameter<const atom *> &, std::string _title, QBoxLayout *_parent,Dialog *_dialog);
|
---|
40 | virtual ~AtomQtQuery();
|
---|
41 | virtual bool handle();
|
---|
42 |
|
---|
43 | public slots:
|
---|
44 | void onUpdate(int);
|
---|
45 |
|
---|
46 | private:
|
---|
47 | QBoxLayout *parent;
|
---|
48 | QBoxLayout *thisLayout;
|
---|
49 | QLabel *titleLabel;
|
---|
50 | QComboBox *inputBox;
|
---|
51 | Dialog *dialog;
|
---|
52 | };
|
---|
53 |
|
---|
54 | class QtDialog::AtomsQtQuery : public QWidget, public Dialog::AtomsQuery {
|
---|
55 | Q_OBJECT
|
---|
56 | public:
|
---|
57 | AtomsQtQuery(Parameter<std::vector<const atom *> > &, std::string _title, QBoxLayout *_parent,Dialog *_dialog);
|
---|
58 | virtual ~AtomsQtQuery();
|
---|
59 | virtual bool handle();
|
---|
60 |
|
---|
61 | public slots:
|
---|
62 | void onUpdate();
|
---|
63 |
|
---|
64 | private:
|
---|
65 | QBoxLayout *parent;
|
---|
66 | QBoxLayout *thisLayout;
|
---|
67 | QLabel *titleLabel;
|
---|
68 | QLabel *inputLabel;
|
---|
69 | QListWidget *inputList;
|
---|
70 | Dialog *dialog;
|
---|
71 | };
|
---|
72 |
|
---|
73 | class QtDialog::BooleanQtQuery : public QWidget, public Dialog::BooleanQuery {
|
---|
74 | Q_OBJECT
|
---|
75 | public:
|
---|
76 | BooleanQtQuery(Parameter<bool> &, std::string _title, QBoxLayout *_parent, Dialog *_dialog);
|
---|
77 | virtual ~BooleanQtQuery();
|
---|
78 | virtual bool handle();
|
---|
79 |
|
---|
80 | public slots:
|
---|
81 | void onUpdate(int);
|
---|
82 |
|
---|
83 | private:
|
---|
84 | QBoxLayout *parent;
|
---|
85 | QBoxLayout *thisLayout;
|
---|
86 | QLabel *titleLabel;
|
---|
87 | QCheckBox *booleanCheckBox;
|
---|
88 | Dialog *dialog;
|
---|
89 | };
|
---|
90 |
|
---|
91 | class QtDialog::RealSpaceMatrixQtQuery : public QWidget, public Dialog::RealSpaceMatrixQuery {
|
---|
92 | Q_OBJECT
|
---|
93 | public:
|
---|
94 | RealSpaceMatrixQtQuery(Parameter<RealSpaceMatrix> &, std::string _title, QBoxLayout *_parent,Dialog *_dialog);
|
---|
95 | virtual ~RealSpaceMatrixQtQuery();
|
---|
96 | virtual bool handle();
|
---|
97 |
|
---|
98 | public slots:
|
---|
99 | void onUpdate(int, int);
|
---|
100 |
|
---|
101 | private:
|
---|
102 | QBoxLayout *parent;
|
---|
103 | QBoxLayout *thisLayout;
|
---|
104 | QLabel *titleLabel;
|
---|
105 | QTableWidget *inputTable;
|
---|
106 | Dialog *dialog;
|
---|
107 | };
|
---|
108 |
|
---|
109 | class QtDialog::DoubleQtQuery : public QWidget, public Dialog::DoubleQuery {
|
---|
110 | Q_OBJECT
|
---|
111 | public:
|
---|
112 | DoubleQtQuery(Parameter<double> &, std::string title,QBoxLayout *_parent,Dialog *_dialog);
|
---|
113 | virtual ~DoubleQtQuery();
|
---|
114 | virtual bool handle();
|
---|
115 |
|
---|
116 | public slots:
|
---|
117 | void onUpdate(double);
|
---|
118 |
|
---|
119 | private:
|
---|
120 | QBoxLayout *parent;
|
---|
121 | QBoxLayout *thisLayout;
|
---|
122 | QLabel *titleLabel;
|
---|
123 | QDoubleSpinBox *inputBox;
|
---|
124 | Dialog *dialog;
|
---|
125 | };
|
---|
126 |
|
---|
127 | class QtDialog::DoublesQtQuery : public QWidget, public Dialog::DoublesQuery {
|
---|
128 | Q_OBJECT
|
---|
129 | public:
|
---|
130 | DoublesQtQuery(Parameter<std::vector<double> > &, std::string title,QBoxLayout *_parent,Dialog *_dialog);
|
---|
131 | virtual ~DoublesQtQuery();
|
---|
132 | virtual bool handle();
|
---|
133 |
|
---|
134 | public slots:
|
---|
135 | void onUpdate();
|
---|
136 |
|
---|
137 | private:
|
---|
138 | QBoxLayout *parent;
|
---|
139 | QBoxLayout *thisLayout;
|
---|
140 | QLabel *titleLabel;
|
---|
141 | QDoubleSpinBox *inputBox;
|
---|
142 | Dialog *dialog;
|
---|
143 | };
|
---|
144 |
|
---|
145 | class QtDialog::ElementQtQuery : public QWidget, public Dialog::ElementQuery {
|
---|
146 | Q_OBJECT
|
---|
147 | public:
|
---|
148 | ElementQtQuery(Parameter<const element *> &, std::string _title, QBoxLayout *_parent, Dialog *_dialog);
|
---|
149 | virtual ~ElementQtQuery();
|
---|
150 | virtual bool handle();
|
---|
151 |
|
---|
152 | public slots:
|
---|
153 | void onUpdate(int);
|
---|
154 |
|
---|
155 | private:
|
---|
156 | QBoxLayout *parent;
|
---|
157 | QBoxLayout *thisLayout;
|
---|
158 | QLabel *titleLabel;
|
---|
159 | QComboBox *inputBox;
|
---|
160 | Dialog *dialog;
|
---|
161 | };
|
---|
162 |
|
---|
163 | class QtDialog::ElementsQtQuery : public QWidget, public Dialog::ElementsQuery {
|
---|
164 | Q_OBJECT
|
---|
165 | public:
|
---|
166 | ElementsQtQuery(Parameter<std::vector<const element *> > &, std::string _title, QBoxLayout *_parent, Dialog *_dialog);
|
---|
167 | virtual ~ElementsQtQuery();
|
---|
168 | virtual bool handle();
|
---|
169 |
|
---|
170 | public slots:
|
---|
171 | void onUpdate();
|
---|
172 |
|
---|
173 | private:
|
---|
174 | QBoxLayout *parent;
|
---|
175 | QBoxLayout *thisLayout;
|
---|
176 | QLabel *titleLabel;
|
---|
177 | QComboBox *inputBox;
|
---|
178 | Dialog *dialog;
|
---|
179 | };
|
---|
180 |
|
---|
181 | class QtDialog::EmptyQtQuery : public Dialog::EmptyQuery {
|
---|
182 | public:
|
---|
183 | EmptyQtQuery(std::string _title, QBoxLayout *_parent, Dialog *_dialog);
|
---|
184 | virtual ~EmptyQtQuery();
|
---|
185 | virtual bool handle();
|
---|
186 | private:
|
---|
187 | QBoxLayout *parent;
|
---|
188 | QBoxLayout *thisLayout;
|
---|
189 | QLabel *titleLabel;
|
---|
190 | Dialog *dialog;
|
---|
191 | };
|
---|
192 |
|
---|
193 | class QtDialog::FileQtQuery : public QWidget, public Dialog::FileQuery {
|
---|
194 | Q_OBJECT
|
---|
195 | public:
|
---|
196 | FileQtQuery(Parameter<boost::filesystem::path> &, std::string _title, QBoxLayout *_parent, Dialog *_dialog);
|
---|
197 | virtual ~FileQtQuery();
|
---|
198 | virtual bool handle();
|
---|
199 |
|
---|
200 | public slots:
|
---|
201 | void onUpdate();
|
---|
202 | void showFileDialog();
|
---|
203 |
|
---|
204 | private:
|
---|
205 | QBoxLayout *parent;
|
---|
206 | QBoxLayout *thisLayout;
|
---|
207 | QLabel *filenameLabel;
|
---|
208 | QLineEdit *filenameLineEdit;
|
---|
209 | QPushButton *filedialogButton;
|
---|
210 | QFileDialog *theFileDialog;
|
---|
211 | Dialog *dialog;
|
---|
212 | };
|
---|
213 |
|
---|
214 | class QtDialog::FilesQtQuery : public QWidget, public Dialog::FilesQuery {
|
---|
215 | Q_OBJECT
|
---|
216 | public:
|
---|
217 | FilesQtQuery(Parameter<std::vector< boost::filesystem::path> > &, std::string _title, QBoxLayout *_parent, Dialog *_dialog);
|
---|
218 | virtual ~FilesQtQuery();
|
---|
219 | virtual bool handle();
|
---|
220 | void IntegerEntered(const QString&);
|
---|
221 | void IntegerSelected();
|
---|
222 | void AddInteger();
|
---|
223 | void RemoveInteger();
|
---|
224 |
|
---|
225 | public slots:
|
---|
226 | void onUpdate();
|
---|
227 |
|
---|
228 | private:
|
---|
229 | QBoxLayout *parent;
|
---|
230 | QBoxLayout *thisLayout;
|
---|
231 | QLabel *titleLabel;
|
---|
232 | Dialog *dialog;
|
---|
233 | };
|
---|
234 |
|
---|
235 | class QtDialog::IntQtQuery : public QWidget, public Dialog::IntQuery {
|
---|
236 | Q_OBJECT
|
---|
237 | public:
|
---|
238 | IntQtQuery(Parameter<int> &, std::string _title,QBoxLayout *_parent,Dialog *_dialog);
|
---|
239 | virtual ~IntQtQuery();
|
---|
240 | virtual bool handle();
|
---|
241 |
|
---|
242 | public slots:
|
---|
243 | void onUpdate(int);
|
---|
244 |
|
---|
245 | private:
|
---|
246 | QBoxLayout *parent;
|
---|
247 | QBoxLayout *thisLayout;
|
---|
248 | QLabel *titleLabel;
|
---|
249 | QSpinBox *inputBox;
|
---|
250 | Dialog *dialog;
|
---|
251 | };
|
---|
252 |
|
---|
253 | class QtDialog::IntsQtQuery : public QWidget, public Dialog::IntsQuery {
|
---|
254 | Q_OBJECT
|
---|
255 | public:
|
---|
256 | IntsQtQuery(Parameter<std::vector<int> > &, std::string _title,QBoxLayout *_parent,Dialog *_dialog);
|
---|
257 | virtual ~IntsQtQuery();
|
---|
258 | virtual bool handle();
|
---|
259 | void IntegerEntered(const QString&);
|
---|
260 | void IntegerSelected();
|
---|
261 | void AddInteger();
|
---|
262 | void RemoveInteger();
|
---|
263 |
|
---|
264 | public slots:
|
---|
265 | void onUpdate();
|
---|
266 |
|
---|
267 | private:
|
---|
268 | QBoxLayout *parent;
|
---|
269 | QBoxLayout *thisLayout;
|
---|
270 | QLabel *titleLabel;
|
---|
271 | Dialog *dialog;
|
---|
272 | };
|
---|
273 |
|
---|
274 | class QtDialog::MoleculeQtQuery : public QWidget, public Dialog::MoleculeQuery {
|
---|
275 | Q_OBJECT
|
---|
276 | public:
|
---|
277 | MoleculeQtQuery(Parameter<const molecule *> &, std::string _title, QBoxLayout *_parent,Dialog *_dialog);
|
---|
278 | virtual ~MoleculeQtQuery();
|
---|
279 | virtual bool handle();
|
---|
280 |
|
---|
281 | public slots:
|
---|
282 | void onUpdate(int);
|
---|
283 |
|
---|
284 | private:
|
---|
285 | QBoxLayout *parent;
|
---|
286 | QBoxLayout *thisLayout;
|
---|
287 | QLabel *titleLabel;
|
---|
288 | QComboBox *inputBox;
|
---|
289 | Dialog *dialog;
|
---|
290 | };
|
---|
291 |
|
---|
292 | class QtDialog::MoleculesQtQuery : public QWidget, public Dialog::MoleculesQuery {
|
---|
293 | Q_OBJECT
|
---|
294 | public:
|
---|
295 | MoleculesQtQuery(Parameter<std::vector<const molecule *> > &, std::string _title, QBoxLayout *_parent,Dialog *_dialog);
|
---|
296 | virtual ~MoleculesQtQuery();
|
---|
297 | virtual bool handle();
|
---|
298 |
|
---|
299 | public slots:
|
---|
300 | void onUpdate();
|
---|
301 |
|
---|
302 | private:
|
---|
303 | QBoxLayout *parent;
|
---|
304 | QBoxLayout *thisLayout;
|
---|
305 | QLabel *titleLabel;
|
---|
306 | QComboBox *inputBox;
|
---|
307 | Dialog *dialog;
|
---|
308 | };
|
---|
309 |
|
---|
310 | class QtDialog::StringQtQuery : public QWidget, public Dialog::StringQuery {
|
---|
311 | Q_OBJECT
|
---|
312 | public:
|
---|
313 | StringQtQuery(Parameter<std::string> &, std::string _title, QBoxLayout *_parent,Dialog *_dialog);
|
---|
314 | virtual ~StringQtQuery();
|
---|
315 | virtual bool handle();
|
---|
316 |
|
---|
317 | public slots:
|
---|
318 | void onUpdate(const QString&);
|
---|
319 |
|
---|
320 | private:
|
---|
321 | QBoxLayout *parent;
|
---|
322 | QBoxLayout *thisLayout;
|
---|
323 | QLabel *titleLabel;
|
---|
324 | QLineEdit *inputBox;
|
---|
325 | Dialog *dialog;
|
---|
326 | };
|
---|
327 |
|
---|
328 | class QtDialog::StringsQtQuery : public QWidget, public Dialog::StringsQuery {
|
---|
329 | Q_OBJECT
|
---|
330 | public:
|
---|
331 | StringsQtQuery(Parameter<std::vector<std::string> > &, std::string _title, QBoxLayout *_parent,Dialog *_dialog);
|
---|
332 | virtual ~StringsQtQuery();
|
---|
333 | virtual bool handle();
|
---|
334 |
|
---|
335 | public slots:
|
---|
336 | void onUpdate();
|
---|
337 |
|
---|
338 | private:
|
---|
339 | QBoxLayout *parent;
|
---|
340 | QBoxLayout *thisLayout;
|
---|
341 | QLabel *titleLabel;
|
---|
342 | QLineEdit *inputBox;
|
---|
343 | Dialog *dialog;
|
---|
344 | };
|
---|
345 |
|
---|
346 | class QtDialog::UnsignedIntQtQuery : public QWidget, public Dialog::UnsignedIntQuery {
|
---|
347 | Q_OBJECT
|
---|
348 | public:
|
---|
349 | UnsignedIntQtQuery(Parameter<unsigned int> &, std::string _title,QBoxLayout *_parent,Dialog *_dialog);
|
---|
350 | virtual ~UnsignedIntQtQuery();
|
---|
351 | virtual bool handle();
|
---|
352 |
|
---|
353 | public slots:
|
---|
354 | void onUpdate(unsigned int);
|
---|
355 |
|
---|
356 | private:
|
---|
357 | QBoxLayout *parent;
|
---|
358 | QBoxLayout *thisLayout;
|
---|
359 | QLabel *titleLabel;
|
---|
360 | QSpinBox *inputBox;
|
---|
361 | Dialog *dialog;
|
---|
362 | };
|
---|
363 |
|
---|
364 | class QtDialog::UnsignedIntsQtQuery : public QWidget, public Dialog::UnsignedIntsQuery {
|
---|
365 | Q_OBJECT
|
---|
366 | public:
|
---|
367 | UnsignedIntsQtQuery(Parameter<std::vector<unsigned int> > &, std::string _title,QBoxLayout *_parent,Dialog *_dialog);
|
---|
368 | virtual ~UnsignedIntsQtQuery();
|
---|
369 | virtual bool handle();
|
---|
370 | void IntegerEntered(const QString&);
|
---|
371 | void IntegerSelected();
|
---|
372 | void AddInteger();
|
---|
373 | void RemoveInteger();
|
---|
374 |
|
---|
375 | public slots:
|
---|
376 | void onUpdate();
|
---|
377 |
|
---|
378 | private:
|
---|
379 | QBoxLayout *parent;
|
---|
380 | QBoxLayout *thisLayout;
|
---|
381 | QLabel *titleLabel;
|
---|
382 | Dialog *dialog;
|
---|
383 | };
|
---|
384 |
|
---|
385 |
|
---|
386 | class QtDialog::VectorQtQuery : public QWidget, public Dialog::VectorQuery {
|
---|
387 | Q_OBJECT
|
---|
388 | public:
|
---|
389 | VectorQtQuery(Parameter<Vector> &, std::string title,QBoxLayout *,Dialog *);
|
---|
390 | virtual ~VectorQtQuery();
|
---|
391 | virtual bool handle();
|
---|
392 |
|
---|
393 | public slots:
|
---|
394 | void onUpdateX(double);
|
---|
395 | void onUpdateY(double);
|
---|
396 | void onUpdateZ(double);
|
---|
397 |
|
---|
398 | private:
|
---|
399 | QBoxLayout *parent;
|
---|
400 | QBoxLayout *mainLayout;
|
---|
401 | QLabel *titleLabel;
|
---|
402 | QBoxLayout *subLayout;
|
---|
403 | QBoxLayout *coordLayout;
|
---|
404 | QLabel *coordLabel;
|
---|
405 | QDoubleSpinBox *coordInputX;
|
---|
406 | QDoubleSpinBox *coordInputY;
|
---|
407 | QDoubleSpinBox *coordInputZ;
|
---|
408 | Dialog *dialog;
|
---|
409 | };
|
---|
410 |
|
---|
411 | class QtDialog::VectorsQtQuery : public QWidget, public Dialog::VectorsQuery {
|
---|
412 | Q_OBJECT
|
---|
413 | public:
|
---|
414 | VectorsQtQuery(Parameter<std::vector<Vector> > &, std::string title,QBoxLayout *,Dialog *);
|
---|
415 | virtual ~VectorsQtQuery();
|
---|
416 | virtual bool handle();
|
---|
417 |
|
---|
418 | public slots:
|
---|
419 | void onUpdate();
|
---|
420 |
|
---|
421 | private:
|
---|
422 | QBoxLayout *parent;
|
---|
423 | QBoxLayout *mainLayout;
|
---|
424 | QLabel *titleLabel;
|
---|
425 | QBoxLayout *subLayout;
|
---|
426 | QBoxLayout *coordLayout;
|
---|
427 | QLabel *coordLabel;
|
---|
428 | QDoubleSpinBox *coordInput;
|
---|
429 | Dialog *dialog;
|
---|
430 | };
|
---|
431 |
|
---|
432 | class QtDialog::RandomNumberDistribution_ParametersQtQuery : public QWidget, public Dialog::RandomNumberDistribution_ParametersQuery {
|
---|
433 | Q_OBJECT
|
---|
434 | public:
|
---|
435 | RandomNumberDistribution_ParametersQtQuery(Parameter<RandomNumberDistribution_Parameters> &, std::string title,QBoxLayout *,Dialog *);
|
---|
436 | virtual ~RandomNumberDistribution_ParametersQtQuery();
|
---|
437 | virtual bool handle();
|
---|
438 |
|
---|
439 | public slots:
|
---|
440 | void onUpdate();
|
---|
441 |
|
---|
442 | private:
|
---|
443 | QBoxLayout *parent;
|
---|
444 | QHBoxLayout *thisLayout;
|
---|
445 | QLabel *titleLabel;
|
---|
446 | QTextEdit *inputBox;
|
---|
447 | QPushButton *okButton;
|
---|
448 | Dialog *dialog;
|
---|
449 | };
|
---|
450 |
|
---|
451 | #endif /* QTQUERY_HPP_ */
|
---|