source: src/UIElements/Qt4/QtDialog.hpp@ 308aa4

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 308aa4 was 308aa4, checked in by Frederik Heber <heber@…>, 14 years ago

Moved declaration for all QtQuery.. into own header file.

  • Query module just need this header file.
  • QtDialog declaration just has forward declarations.
  • Property mode set to 100644
File size: 7.4 KB
Line 
1/*
2 * QtDialog.hpp
3 *
4 * Created on: Jan 18, 2010
5 * Author: crueger
6 */
7
8#ifndef QTDIALOG_HPP_
9#define QTDIALOG_HPP_
10
11#include "UIElements/Dialog.hpp"
12#include <QtGui/QDialog>
13#include <QtGui/QFileDialog>
14
15#include <boost/filesystem.hpp>
16
17#include <map>
18#include <set>
19#include <vector>
20
21class QBoxLayout;
22class QLabel;
23class QSpinBox;
24class QDoubleSpinBox;
25class QLineEdit;
26class QListWidget;
27class QTableWidget;
28class QComboBox;
29class QDialogButtonBox;
30
31class Matrix;
32
33
34class QtDialog : public QDialog, public Dialog
35{
36 Q_OBJECT
37public:
38 QtDialog();
39 virtual ~QtDialog();
40
41 virtual void queryEmpty(const char*, std::string);
42 virtual void queryBoolean(const char *, std::string = "");
43 virtual void queryInt(const char *,std::string = "");
44 virtual void queryInts(const char *,std::string = "");
45 virtual void queryDouble(const char*,std::string = "");
46 virtual void queryDoubles(const char*,std::string = "");
47 virtual void queryString(const char*,std::string = "");
48 virtual void queryStrings(const char*,std::string = "");
49 virtual void queryAtom(const char*,std::string = "");
50 virtual void queryAtoms(const char*,std::string = "");
51 virtual void queryMolecule(const char*,std::string = "");
52 virtual void queryMolecules(const char*,std::string = "");
53 virtual void queryVector(const char*,bool,std::string = "");
54 virtual void queryVectors(const char*,bool,std::string = "");
55 virtual void queryBox(const char*, std::string = "");
56 virtual void queryElement(const char*,std::string = "");
57 virtual void queryElements(const char*,std::string = "");
58 virtual void queryFile(const char*,std::string = "");
59
60 virtual bool display();
61
62 virtual void update();
63
64protected:
65 class AtomQtQuery;
66 class AtomsQtQuery;
67 class BooleanQtQuery;
68 class BoxQtQuery;
69 class DoubleQtQuery;
70 class DoublesQtQuery;
71 class ElementQtQuery;
72 class ElementsQtQuery;
73 class EmptyQtQuery;
74 class FileQtQuery;
75 class IntQtQuery;
76 class IntsQtQuery;
77 class MoleculeQtQuery;
78 class MoleculesQtQuery;
79 class StringQtQuery;
80 class StringsQtQuery;
81 class VectorQtQuery;
82 class VectorsQtQuery;
83
84private:
85 QBoxLayout *mainLayout;
86 QBoxLayout *inputLayout;
87 QBoxLayout *buttonLayout;
88 QDialogButtonBox *buttons;
89};
90
91// All kinds of plumbing for Queries
92// Plumbing needs to be outside of the class where it is needed,
93// since MOC doesn't like nested classes
94
95
96template<typename T> class QtQueryListPipe : public QWidget {
97 public:
98 QtQueryListPipe(std::vector<T> *_content, QtDialog *_dialog, QLineEdit *_inputBox, QListWidget *_inputList, QPushButton *_AddButton, QPushButton *_RemoveButton);
99 virtual ~QtQueryListPipe();
100 void AddInteger();
101 void RemoveInteger();
102 void IntegerSelected();
103 void IntegerEntered(const QString&);
104
105 private:
106 void AddValue(T item);
107 void RemoveRow(int row);
108
109 std::vector<T> *content;
110 QtDialog *dialog;
111 QLineEdit *inputBox;
112 QListWidget *inputList;
113 QPushButton *AddButton;
114 QPushButton *RemoveButton;
115};
116
117
118class StringQtQueryPipe : public QWidget {
119 Q_OBJECT
120public:
121 StringQtQueryPipe(std::string *_content, QtDialog *_dialog);
122 virtual ~StringQtQueryPipe();
123
124public slots:
125 void update(const QString&);
126
127private:
128 std::string *content;
129 QtDialog *dialog;
130
131};
132
133class IntQtQueryPipe : public QWidget {
134 Q_OBJECT
135public:
136 IntQtQueryPipe(int *_content, QtDialog *_dialog);
137 virtual ~IntQtQueryPipe();
138
139public slots:
140 void update(int);
141
142private:
143 int *content;
144 QtDialog *dialog;
145
146};
147
148
149class DoubleQtQueryPipe : public QWidget {
150 Q_OBJECT
151public:
152 DoubleQtQueryPipe(double *_content, QtDialog *_dialog);
153 virtual ~DoubleQtQueryPipe();
154
155public slots:
156 void update(double);
157
158private:
159 double *content;
160 QtDialog *dialog;
161
162};
163
164class BoxQtQueryPipe : public QWidget {
165 Q_OBJECT
166public:
167 BoxQtQueryPipe(Box &_content, QtDialog *_dialog, QTableWidget *_inputTable);
168 virtual ~BoxQtQueryPipe();
169
170public slots:
171 void update(int,int);
172
173private:
174 Box &content;
175 QtDialog *dialog;
176 QTableWidget *inputTable;
177
178 Matrix *tmpM;
179};
180
181
182class AtomQtQueryPipe : public QWidget {
183 Q_OBJECT
184public:
185 AtomQtQueryPipe(const atom **_content, QtDialog *_dialog, QComboBox *_theBox);
186 virtual ~AtomQtQueryPipe();
187
188public slots:
189 void update(int);
190
191private:
192 const atom **content;
193 QtDialog *dialog;
194 QComboBox *theBox;
195
196};
197
198
199class AtomsQtQueryPipe : public QWidget {
200 Q_OBJECT
201public:
202 AtomsQtQueryPipe(std::vector<const atom *>*_content, QtDialog *_dialog, QListWidget *_theList);
203 virtual ~AtomsQtQueryPipe();
204
205public slots:
206 void update();
207 void add();
208 void remove();
209
210private:
211 std::vector<const atom *>*content;
212 std::map<int, const atom *> lookup;
213 std::set<const atom *> currentList;
214 QtDialog *dialog;
215 QListWidget *theList;
216
217};
218
219class MoleculeQtQueryPipe : public QWidget {
220 Q_OBJECT
221public:
222 MoleculeQtQueryPipe(const molecule **_content, QtDialog *_dialog, QComboBox *_theBox);
223 virtual ~MoleculeQtQueryPipe();
224
225public slots:
226 void update(int);
227
228private:
229 const molecule **content;
230 QtDialog *dialog;
231 QComboBox *theBox;
232
233};
234
235class MoleculesQtQueryPipe : public QWidget {
236 Q_OBJECT
237public:
238 MoleculesQtQueryPipe(std::vector<const molecule *>*_content, QtDialog *_dialog, QComboBox *_theBox);
239 virtual ~MoleculesQtQueryPipe();
240
241public slots:
242 void update(int);
243
244private:
245 std::vector<const molecule *>*content;
246 QtDialog *dialog;
247 QComboBox *theBox;
248
249};
250
251class VectorQtQueryPipe : public QWidget {
252 Q_OBJECT
253public:
254 VectorQtQueryPipe(Vector *_content, QtDialog *_dialog, QComboBox *_theBox);
255 virtual ~VectorQtQueryPipe();
256
257public slots:
258 void update();
259
260private:
261 Vector *content;
262 QtDialog *dialog;
263 QComboBox *theBox;
264};
265
266class VectorsQtQueryPipe : public QWidget {
267 Q_OBJECT
268public:
269 VectorsQtQueryPipe(std::vector<Vector>*_content, QtDialog *_dialog, QComboBox *_theBox);
270 virtual ~VectorsQtQueryPipe();
271
272public slots:
273 void update();
274
275private:
276 std::vector<Vector> *content;
277 QtDialog *dialog;
278 QComboBox *theBox;
279};
280
281class EmptyQtQueryPipe : public QWidget {
282 Q_OBJECT
283public:
284 EmptyQtQueryPipe(QtDialog *_dialog, QLabel *_textLabel);
285 virtual ~EmptyQtQueryPipe();
286
287public slots:
288 void update();
289
290private:
291 QtDialog *dialog;
292 QLabel *textLabel;
293};
294
295class BooleanQtQueryPipe : public QWidget {
296 Q_OBJECT
297public:
298 BooleanQtQueryPipe(const bool *_content, QtDialog *_dialog, QComboBox *_booleanComboBox);
299 virtual ~BooleanQtQueryPipe();
300
301public slots:
302 void update();
303
304private:
305 const bool *content;
306 QtDialog *dialog;
307 QComboBox *booleanComboBox;
308};
309
310class ElementQtQueryPipe : public QWidget {
311 Q_OBJECT
312public:
313 ElementQtQueryPipe(const element **_content, QtDialog *_dialog, QComboBox *_theBox);
314 virtual ~ElementQtQueryPipe();
315
316public slots:
317 void update(int);
318
319private:
320 const element **content;
321 QtDialog *dialog;
322 QComboBox *theBox;
323};
324
325class ElementsQtQueryPipe : public QWidget {
326 Q_OBJECT
327public:
328 ElementsQtQueryPipe(std::vector<const element *>*_content, QtDialog *_dialog, QComboBox *_theBox);
329 virtual ~ElementsQtQueryPipe();
330
331public slots:
332 void update(int);
333
334private:
335 std::vector<const element *>*content;
336 QtDialog *dialog;
337 QComboBox *theBox;
338};
339
340class FileQtQueryPipe : public QWidget {
341 Q_OBJECT
342public:
343 FileQtQueryPipe(boost::filesystem::path *_content, QtDialog *_dialog, QLineEdit *_filenameLineEdit, QPushButton *_filedialogButton);
344 virtual ~FileQtQueryPipe();
345
346public slots:
347 void update();
348 void showFileDialog();
349
350private:
351 boost::filesystem::path *content;
352 QtDialog *dialog;
353 QLineEdit *filenameLineEdit;
354 QPushButton *filedialogButton;
355 QFileDialog *theFileDialog;
356};
357
358#endif /* QTDIALOG_HPP_ */
Note: See TracBrowser for help on using the repository browser.