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 "Qt4/QtDialog.hpp"
|
---|
18 | #include "Parameters/Parameter.hpp"
|
---|
19 |
|
---|
20 | class QHBoxLayout;
|
---|
21 | class QBoxLayout;
|
---|
22 | class QDialogButtonBox;
|
---|
23 | class QLabel;
|
---|
24 | class QSpinBox;
|
---|
25 | class QDoubleSpinBox;
|
---|
26 | class QLineEdit;
|
---|
27 | class QListWidget;
|
---|
28 | class QPushButton;
|
---|
29 | class QTableWidget;
|
---|
30 | class QTextEdit;
|
---|
31 | class QComboBox;
|
---|
32 | class QCheckBox;
|
---|
33 |
|
---|
34 | // Forward declarations for plumbing
|
---|
35 | template<typename T> class QtQueryListPipe;
|
---|
36 | class AtomQtQueryPipe;
|
---|
37 | class AtomsQtQueryPipe;
|
---|
38 | class BooleanQtQueryPipe;
|
---|
39 | class RealSpaceMatrixQtQueryPipe;
|
---|
40 | class DoubleQtQueryPipe;
|
---|
41 | class DoublesQtQueryPipe;
|
---|
42 | class ElementQtQueryPipe;
|
---|
43 | class ElementsQtQueryPipe;
|
---|
44 | class EmptyQtQueryPipe;
|
---|
45 | class FileQtQueryPipe;
|
---|
46 | class IntQtQueryPipe;
|
---|
47 | class MoleculeQtQueryPipe;
|
---|
48 | class MoleculesQtQueryPipe;
|
---|
49 | class StringQtQueryPipe;
|
---|
50 | class StringsQtQueryPipe;
|
---|
51 | class UnsignedIntQtQueryPipe;
|
---|
52 | class UnsignedIntsQtQueryPipe;
|
---|
53 | class VectorQtQueryPipe;
|
---|
54 | class VectorsQtQueryPipe;
|
---|
55 | class RandomNumberDistribution_ParametersQtQueryPipe;
|
---|
56 |
|
---|
57 | class QtDialog::AtomQtQuery : public Dialog::AtomQuery {
|
---|
58 | public:
|
---|
59 | AtomQtQuery(Parameter<const atom *> &, std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
|
---|
60 | virtual ~AtomQtQuery();
|
---|
61 | virtual bool handle();
|
---|
62 | private:
|
---|
63 | QBoxLayout *parent;
|
---|
64 | QBoxLayout *thisLayout;
|
---|
65 | QLabel *titleLabel;
|
---|
66 | QComboBox *inputBox;
|
---|
67 |
|
---|
68 | AtomQtQueryPipe *pipe;
|
---|
69 | };
|
---|
70 |
|
---|
71 | class QtDialog::AtomsQtQuery : public Dialog::AtomsQuery {
|
---|
72 | public:
|
---|
73 | AtomsQtQuery(Parameter<std::vector<const atom *> > &, std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
|
---|
74 | virtual ~AtomsQtQuery();
|
---|
75 | virtual bool handle();
|
---|
76 | private:
|
---|
77 | QBoxLayout *parent;
|
---|
78 | QBoxLayout *thisLayout;
|
---|
79 | QLabel *titleLabel;
|
---|
80 | QLabel *inputLabel;
|
---|
81 | QListWidget *inputList;
|
---|
82 |
|
---|
83 | AtomsQtQueryPipe *pipe;
|
---|
84 | };
|
---|
85 |
|
---|
86 | class QtDialog::BooleanQtQuery : public Dialog::BooleanQuery {
|
---|
87 | public:
|
---|
88 | BooleanQtQuery(Parameter<bool> &, std::string _title, QBoxLayout *_parent, QtDialog *_dialog);
|
---|
89 | virtual ~BooleanQtQuery();
|
---|
90 | virtual bool handle();
|
---|
91 | private:
|
---|
92 | QBoxLayout *parent;
|
---|
93 | QBoxLayout *thisLayout;
|
---|
94 | QLabel *titleLabel;
|
---|
95 | QCheckBox *booleanCheckBox;
|
---|
96 |
|
---|
97 | BooleanQtQueryPipe *pipe;
|
---|
98 | };
|
---|
99 |
|
---|
100 | class QtDialog::RealSpaceMatrixQtQuery : public Dialog::RealSpaceMatrixQuery {
|
---|
101 | public:
|
---|
102 | RealSpaceMatrixQtQuery(Parameter<RealSpaceMatrix> &, std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
|
---|
103 | virtual ~RealSpaceMatrixQtQuery();
|
---|
104 | virtual bool handle();
|
---|
105 | private:
|
---|
106 | QBoxLayout *parent;
|
---|
107 | QBoxLayout *thisLayout;
|
---|
108 | QLabel *titleLabel;
|
---|
109 | QTableWidget *inputTable;
|
---|
110 |
|
---|
111 | RealSpaceMatrixQtQueryPipe *pipe;
|
---|
112 | };
|
---|
113 |
|
---|
114 | class QtDialog::DoubleQtQuery : public Dialog::DoubleQuery {
|
---|
115 | public:
|
---|
116 | DoubleQtQuery(Parameter<double> &, std::string title,QBoxLayout *_parent,QtDialog *_dialog);
|
---|
117 | virtual ~DoubleQtQuery();
|
---|
118 | virtual bool handle();
|
---|
119 | private:
|
---|
120 | QBoxLayout *parent;
|
---|
121 | QBoxLayout *thisLayout;
|
---|
122 | QLabel *titleLabel;
|
---|
123 | QDoubleSpinBox *inputBox;
|
---|
124 |
|
---|
125 | DoubleQtQueryPipe *pipe;
|
---|
126 | };
|
---|
127 |
|
---|
128 | class QtDialog::DoublesQtQuery : public Dialog::DoublesQuery {
|
---|
129 | public:
|
---|
130 | DoublesQtQuery(Parameter<std::vector<double> > &, std::string title,QBoxLayout *_parent,QtDialog *_dialog);
|
---|
131 | virtual ~DoublesQtQuery();
|
---|
132 | virtual bool handle();
|
---|
133 | private:
|
---|
134 | QBoxLayout *parent;
|
---|
135 | QBoxLayout *thisLayout;
|
---|
136 | QLabel *titleLabel;
|
---|
137 | QDoubleSpinBox *inputBox;
|
---|
138 |
|
---|
139 | QtQueryListPipe<double> *pipe;
|
---|
140 | };
|
---|
141 |
|
---|
142 | class QtDialog::ElementQtQuery : public Dialog::ElementQuery {
|
---|
143 | public:
|
---|
144 | ElementQtQuery(Parameter<const element *> &, std::string _title, QBoxLayout *_parent, QtDialog *_dialog);
|
---|
145 | virtual ~ElementQtQuery();
|
---|
146 | virtual bool handle();
|
---|
147 | private:
|
---|
148 | QBoxLayout *parent;
|
---|
149 | QBoxLayout *thisLayout;
|
---|
150 | QLabel *titleLabel;
|
---|
151 | QComboBox *inputBox;
|
---|
152 |
|
---|
153 | ElementQtQueryPipe *pipe;
|
---|
154 | };
|
---|
155 |
|
---|
156 | class QtDialog::ElementsQtQuery : public Dialog::ElementsQuery {
|
---|
157 | public:
|
---|
158 | ElementsQtQuery(Parameter<std::vector<const element *> > &, std::string _title, QBoxLayout *_parent, QtDialog *_dialog);
|
---|
159 | virtual ~ElementsQtQuery();
|
---|
160 | virtual bool handle();
|
---|
161 | private:
|
---|
162 | QBoxLayout *parent;
|
---|
163 | QBoxLayout *thisLayout;
|
---|
164 | QLabel *titleLabel;
|
---|
165 | QComboBox *inputBox;
|
---|
166 |
|
---|
167 | ElementsQtQueryPipe *pipe;
|
---|
168 | };
|
---|
169 |
|
---|
170 | class QtDialog::EmptyQtQuery : public Dialog::EmptyQuery {
|
---|
171 | public:
|
---|
172 | EmptyQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog);
|
---|
173 | virtual ~EmptyQtQuery();
|
---|
174 | virtual bool handle();
|
---|
175 | private:
|
---|
176 | QBoxLayout *parent;
|
---|
177 | QBoxLayout *thisLayout;
|
---|
178 | QLabel *titleLabel;
|
---|
179 |
|
---|
180 | EmptyQtQueryPipe *pipe;
|
---|
181 | };
|
---|
182 |
|
---|
183 | class QtDialog::FileQtQuery : public Dialog::FileQuery {
|
---|
184 | public:
|
---|
185 | FileQtQuery(Parameter<boost::filesystem::path> &, std::string _title, QBoxLayout *_parent, QtDialog *_dialog);
|
---|
186 | virtual ~FileQtQuery();
|
---|
187 | virtual bool handle();
|
---|
188 | private:
|
---|
189 | QBoxLayout *parent;
|
---|
190 | QBoxLayout *thisLayout;
|
---|
191 | QLabel *filenameLabel;
|
---|
192 | QLineEdit *filenameLineEdit;
|
---|
193 | QPushButton *filedialogButton;
|
---|
194 |
|
---|
195 | FileQtQueryPipe *pipe;
|
---|
196 | };
|
---|
197 |
|
---|
198 | class QtDialog::IntQtQuery : public Dialog::IntQuery {
|
---|
199 | public:
|
---|
200 | IntQtQuery(Parameter<int> &, std::string _title,QBoxLayout *_parent,QtDialog *_dialog);
|
---|
201 | virtual ~IntQtQuery();
|
---|
202 | virtual bool handle();
|
---|
203 | private:
|
---|
204 | QBoxLayout *parent;
|
---|
205 | QBoxLayout *thisLayout;
|
---|
206 | QLabel *titleLabel;
|
---|
207 | QSpinBox *inputBox;
|
---|
208 |
|
---|
209 | IntQtQueryPipe *pipe;
|
---|
210 | };
|
---|
211 |
|
---|
212 | class QtDialog::IntsQtQuery : public Dialog::IntsQuery {
|
---|
213 | public:
|
---|
214 | IntsQtQuery(Parameter<std::vector<int> > &, std::string _title,QBoxLayout *_parent,QtDialog *_dialog);
|
---|
215 | virtual ~IntsQtQuery();
|
---|
216 | virtual bool handle();
|
---|
217 | void IntegerEntered(const QString&);
|
---|
218 | void IntegerSelected();
|
---|
219 | void AddInteger();
|
---|
220 | void RemoveInteger();
|
---|
221 | private:
|
---|
222 | QBoxLayout *parent;
|
---|
223 | QBoxLayout *thisLayout;
|
---|
224 | QLabel *titleLabel;
|
---|
225 |
|
---|
226 | QtQueryListPipe<int> *pipe;
|
---|
227 | };
|
---|
228 |
|
---|
229 | class QtDialog::MoleculeQtQuery : public Dialog::MoleculeQuery {
|
---|
230 | public:
|
---|
231 | MoleculeQtQuery(Parameter<const molecule *> &, std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
|
---|
232 | virtual ~MoleculeQtQuery();
|
---|
233 | virtual bool handle();
|
---|
234 | private:
|
---|
235 | QBoxLayout *parent;
|
---|
236 | QBoxLayout *thisLayout;
|
---|
237 | QLabel *titleLabel;
|
---|
238 | QComboBox *inputBox;
|
---|
239 |
|
---|
240 | MoleculeQtQueryPipe *pipe;
|
---|
241 | };
|
---|
242 |
|
---|
243 | class QtDialog::MoleculesQtQuery : public Dialog::MoleculesQuery {
|
---|
244 | public:
|
---|
245 | MoleculesQtQuery(Parameter<std::vector<const molecule *> > &, std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
|
---|
246 | virtual ~MoleculesQtQuery();
|
---|
247 | virtual bool handle();
|
---|
248 | private:
|
---|
249 | QBoxLayout *parent;
|
---|
250 | QBoxLayout *thisLayout;
|
---|
251 | QLabel *titleLabel;
|
---|
252 | QComboBox *inputBox;
|
---|
253 |
|
---|
254 | MoleculesQtQueryPipe *pipe;
|
---|
255 | };
|
---|
256 |
|
---|
257 | class QtDialog::StringQtQuery : public Dialog::StringQuery {
|
---|
258 | public:
|
---|
259 | StringQtQuery(Parameter<std::string> &, std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
|
---|
260 | virtual ~StringQtQuery();
|
---|
261 | virtual bool handle();
|
---|
262 | private:
|
---|
263 | QBoxLayout *parent;
|
---|
264 | QBoxLayout *thisLayout;
|
---|
265 | QLabel *titleLabel;
|
---|
266 | QLineEdit *inputBox;
|
---|
267 |
|
---|
268 | StringQtQueryPipe *pipe;
|
---|
269 | };
|
---|
270 |
|
---|
271 | class QtDialog::StringsQtQuery : public Dialog::StringsQuery {
|
---|
272 | public:
|
---|
273 | StringsQtQuery(Parameter<std::vector<std::string> > &, std::string _title, QBoxLayout *_parent,QtDialog *_dialog);
|
---|
274 | virtual ~StringsQtQuery();
|
---|
275 | virtual bool handle();
|
---|
276 | private:
|
---|
277 | QBoxLayout *parent;
|
---|
278 | QBoxLayout *thisLayout;
|
---|
279 | QLabel *titleLabel;
|
---|
280 | QLineEdit *inputBox;
|
---|
281 |
|
---|
282 | QtQueryListPipe<std::string> *pipe;
|
---|
283 | };
|
---|
284 |
|
---|
285 | class QtDialog::UnsignedIntQtQuery : public Dialog::UnsignedIntQuery {
|
---|
286 | public:
|
---|
287 | UnsignedIntQtQuery(Parameter<unsigned int> &, std::string _title,QBoxLayout *_parent,QtDialog *_dialog);
|
---|
288 | virtual ~UnsignedIntQtQuery();
|
---|
289 | virtual bool handle();
|
---|
290 | private:
|
---|
291 | QBoxLayout *parent;
|
---|
292 | QBoxLayout *thisLayout;
|
---|
293 | QLabel *titleLabel;
|
---|
294 | QSpinBox *inputBox;
|
---|
295 |
|
---|
296 | UnsignedIntQtQueryPipe *pipe;
|
---|
297 | };
|
---|
298 |
|
---|
299 | class QtDialog::UnsignedIntsQtQuery : public Dialog::UnsignedIntsQuery {
|
---|
300 | public:
|
---|
301 | UnsignedIntsQtQuery(Parameter<std::vector<unsigned int> > &, std::string _title,QBoxLayout *_parent,QtDialog *_dialog);
|
---|
302 | virtual ~UnsignedIntsQtQuery();
|
---|
303 | virtual bool handle();
|
---|
304 | void IntegerEntered(const QString&);
|
---|
305 | void IntegerSelected();
|
---|
306 | void AddInteger();
|
---|
307 | void RemoveInteger();
|
---|
308 | private:
|
---|
309 | QBoxLayout *parent;
|
---|
310 | QBoxLayout *thisLayout;
|
---|
311 | QLabel *titleLabel;
|
---|
312 |
|
---|
313 | QtQueryListPipe<unsigned int> *pipe;
|
---|
314 | };
|
---|
315 |
|
---|
316 |
|
---|
317 | class QtDialog::VectorQtQuery : public Dialog::VectorQuery {
|
---|
318 | public:
|
---|
319 | VectorQtQuery(Parameter<Vector> &, std::string title,bool _check,QBoxLayout *,QtDialog *);
|
---|
320 | virtual ~VectorQtQuery();
|
---|
321 | virtual bool handle();
|
---|
322 | private:
|
---|
323 | QBoxLayout *parent;
|
---|
324 | QBoxLayout *mainLayout;
|
---|
325 | QLabel *titleLabel;
|
---|
326 | QBoxLayout *subLayout;
|
---|
327 | QBoxLayout *coordLayout;
|
---|
328 | QLabel *coordLabel;
|
---|
329 | QDoubleSpinBox *coordInputX;
|
---|
330 | QDoubleSpinBox *coordInputY;
|
---|
331 | QDoubleSpinBox *coordInputZ;
|
---|
332 |
|
---|
333 | VectorQtQueryPipe *pipe;
|
---|
334 | };
|
---|
335 |
|
---|
336 | class QtDialog::VectorsQtQuery : public Dialog::VectorsQuery {
|
---|
337 | public:
|
---|
338 | VectorsQtQuery(Parameter<std::vector<Vector> > &, std::string title,bool _check,QBoxLayout *,QtDialog *);
|
---|
339 | virtual ~VectorsQtQuery();
|
---|
340 | virtual bool handle();
|
---|
341 | private:
|
---|
342 | QBoxLayout *parent;
|
---|
343 | QBoxLayout *mainLayout;
|
---|
344 | QLabel *titleLabel;
|
---|
345 | QBoxLayout *subLayout;
|
---|
346 | QBoxLayout *coordLayout;
|
---|
347 | QLabel *coordLabel;
|
---|
348 | QDoubleSpinBox *coordInput;
|
---|
349 |
|
---|
350 | VectorsQtQueryPipe *pipe;
|
---|
351 | };
|
---|
352 |
|
---|
353 | class QtDialog::RandomNumberDistribution_ParametersQtQuery : public Dialog::RandomNumberDistribution_ParametersQuery {
|
---|
354 | public:
|
---|
355 | RandomNumberDistribution_ParametersQtQuery(Parameter<RandomNumberDistribution_Parameters> &, std::string title,QBoxLayout *,QtDialog *);
|
---|
356 | virtual ~RandomNumberDistribution_ParametersQtQuery();
|
---|
357 | virtual bool handle();
|
---|
358 | private:
|
---|
359 | QBoxLayout *parent;
|
---|
360 | QHBoxLayout *thisLayout;
|
---|
361 | QLabel *titleLabel;
|
---|
362 | QTextEdit *inputBox;
|
---|
363 | QPushButton *okButton;
|
---|
364 |
|
---|
365 | RandomNumberDistribution_ParametersQtQueryPipe *pipe;
|
---|
366 | };
|
---|
367 |
|
---|
368 | #endif /* QTQUERY_HPP_ */
|
---|