source: src/UIElements/Qt4/Query/QtQuery.hpp@ 7e6a1b

Action_Thermostats Add_AtomRandomPerturbation Add_FitFragmentPartialChargesAction Add_RotateAroundBondAction Add_SelectAtomByNameAction Added_ParseSaveFragmentResults AddingActions_SaveParseParticleParameters Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_ParticleName_to_Atom Adding_StructOpt_integration_tests AtomFragments Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.5.4 Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator CombiningParticlePotentialParsing Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_BoundInBox_CenterInBox_MoleculeActions Fix_ChargeSampling_PBC Fix_ChronosMutex Fix_FitPartialCharges Fix_FitPotential_needs_atomicnumbers Fix_ForceAnnealing Fix_IndependentFragmentGrids Fix_ParseParticles Fix_ParseParticles_split_forward_backward_Actions Fix_PopActions Fix_QtFragmentList_sorted_selection Fix_Restrictedkeyset_FragmentMolecule Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns Fix_fitting_potentials Fixes ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion FragmentAction_writes_AtomFragments FragmentMolecule_checks_bonddegrees GeometryObjects Gui_Fixes Gui_displays_atomic_force_velocity ImplicitCharges IndependentFragmentGrids IndependentFragmentGrids_IndividualZeroInstances IndependentFragmentGrids_IntegrationTest IndependentFragmentGrids_Sole_NN_Calculation JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix MoreRobust_FragmentAutomation ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PdbParser_setsAtomName PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks Rewrite_FitPartialCharges RotateToPrincipalAxisSystem_UndoRedo SaturateAtoms_findBestMatching SaturateAtoms_singleDegree StoppableMakroAction Subpackage_CodePatterns Subpackage_JobMarket Subpackage_LinearAlgebra Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg Switchable_LogView ThirdParty_MPQC_rebuilt_buildsystem TrajectoryDependenant_MaxOrder TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps TremoloParser_setsAtomName Ubuntu_1604_changes stable
Last change on this file since 7e6a1b was 852ea3, checked in by Michael Ankele <ankele@…>, 13 years ago

further query merging (QtQuery added, handle() won't use param.set())

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