source: src/UIElements/QT4/QTDialog.hpp@ 4e10f5

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 4e10f5 was 4e10f5, checked in by Tillmann Crueger <crueger@…>, 15 years ago

Merge branch 'stable' into StructureRefactoring

Conflicts:

src/Actions/WorldAction/CenterOnEdgeAction.cpp
src/Actions/WorldAction/ChangeBoxAction.cpp
src/Actions/WorldAction/RepeatBoxAction.cpp
src/Actions/WorldAction/ScaleBoxAction.cpp
src/World.cpp
src/boundary.cpp

  • Property mode set to 100644
File size: 5.8 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
14class QBoxLayout;
15class QLabel;
16class QSpinBox;
17class QDoubleSpinBox;
18class QLineEdit;
19class QComboBox;
20class QDialogButtonBox;
21
22
23// Forward declarations for plumbing
24class StringQTQueryPipe;
25class IntQTQueryPipe;
26class DoubleQTQueryPipe;
27class MoleculeQTQueryPipe;
28class ElementQTQueryPipe;
29
30class QTDialog : public QDialog, public Dialog
31{
32 Q_OBJECT
33public:
34 QTDialog();
35 virtual ~QTDialog();
36
37 virtual void queryEmpty(const char*, std::string);
38 virtual void queryBoolean(const char *, bool *, std::string = "");
39 virtual void queryInt(const char *, int *,std::string = "");
40 virtual void queryDouble(const char*,double *,std::string = "");
41 virtual void queryString(const char*, std::string *,std::string = "");
42 virtual void queryStrings(const char*, std::vector<std::string> *,std::string = "");
43 virtual void queryAtom(const char*,atom**,std::string = "");
44 virtual void queryMolecule(const char*,molecule**,std::string = "");
45 virtual void queryVector(const char*,Vector *,bool,std::string = "");
46 virtual void queryBox(const char*,Box*, std::string = "");
47 virtual void queryElement(const char*,std::vector<element *> *_target,std::string = "");
48
49 virtual bool display();
50
51 virtual void update();
52
53protected:
54 class IntQTQuery : public Dialog::IntQuery {
55 public:
56 IntQTQuery(std::string _title, int *_target,QBoxLayout *_parent,QTDialog *_dialog);
57 virtual ~IntQTQuery();
58 virtual bool handle();
59 private:
60 QBoxLayout *parent;
61 QBoxLayout *thisLayout;
62 QLabel *titleLabel;
63 QSpinBox *inputBox;
64
65 IntQTQueryPipe *pipe;
66 };
67
68 class DoubleQTQuery : public Dialog::DoubleQuery {
69 public:
70 DoubleQTQuery(std::string title, double *_target,QBoxLayout *_parent,QTDialog *_dialog);
71 virtual ~DoubleQTQuery();
72 virtual bool handle();
73 private:
74 QBoxLayout *parent;
75 QBoxLayout *thisLayout;
76 QLabel *titleLabel;
77 QDoubleSpinBox *inputBox;
78
79 DoubleQTQueryPipe *pipe;
80 };
81
82 class StringQTQuery : public Dialog::StringQuery {
83 public:
84 StringQTQuery(std::string _title, std::string *_target, QBoxLayout *_parent,QTDialog *_dialog);
85 virtual ~StringQTQuery();
86 virtual bool handle();
87 private:
88 QBoxLayout *parent;
89 QBoxLayout *thisLayout;
90 QLabel *titleLabel;
91 QLineEdit *inputBox;
92
93 StringQTQueryPipe *pipe;
94 };
95
96 class StringsQTQuery : public Dialog::StringsQuery {
97 public:
98 StringsQTQuery(std::string _title, std::vector<std::string> *_target, QBoxLayout *_parent,QTDialog *_dialog);
99 virtual ~StringsQTQuery();
100 virtual bool handle();
101 private:
102 QBoxLayout *parent;
103 QBoxLayout *thisLayout;
104 QLabel *titleLabel;
105 QLineEdit *inputBox;
106
107 StringQTQueryPipe *pipe;
108 };
109
110 class MoleculeQTQuery : public Dialog::MoleculeQuery {
111 public:
112 MoleculeQTQuery(std::string _title, molecule **_target, QBoxLayout *_parent,QTDialog *_dialog);
113 virtual ~MoleculeQTQuery();
114 virtual bool handle();
115 private:
116 QBoxLayout *parent;
117 QBoxLayout *thisLayout;
118 QLabel *titleLabel;
119 QComboBox *inputBox;
120
121 MoleculeQTQueryPipe *pipe;
122 };
123
124 class VectorQTQuery : public Dialog::VectorQuery {
125 public:
126 VectorQTQuery(std::string title,Vector *_target,bool _check,QBoxLayout *,QTDialog *);
127 virtual ~VectorQTQuery();
128 virtual bool handle();
129 private:
130 QBoxLayout *parent;
131 QBoxLayout *mainLayout;
132 QLabel *titleLabel;
133 QBoxLayout *subLayout;
134 QBoxLayout *coordLayout[3];
135 QLabel *coordLabel[3];
136 QDoubleSpinBox *coordInput[3];
137
138 DoubleQTQueryPipe *pipe[3];
139 };
140
141 class ElementQTQuery : public Dialog::ElementQuery {
142 public:
143 ElementQTQuery(std::string _title, std::vector<element *> *_target, QBoxLayout *_parent, QTDialog *_dialog);
144 virtual ~ElementQTQuery();
145 virtual bool handle();
146 private:
147 QBoxLayout *parent;
148 QBoxLayout *thisLayout;
149 QLabel *titleLabel;
150 QComboBox *inputBox;
151
152 ElementQTQueryPipe *pipe;
153 };
154
155private:
156 QBoxLayout *mainLayout;
157 QBoxLayout *inputLayout;
158 QBoxLayout *buttonLayout;
159 QDialogButtonBox *buttons;
160};
161
162// All kinds of plumbing for Queries
163// Plumbing needs to be outside of the class where it is needed,
164// since MOC doesn't like nested classes
165
166class StringQTQueryPipe : public QWidget {
167 Q_OBJECT
168public:
169 StringQTQueryPipe(std::string *_content, QTDialog *_dialog);
170 virtual ~StringQTQueryPipe();
171
172public slots:
173 void update(const QString&);
174
175private:
176 std::string *content;
177 QTDialog *dialog;
178
179};
180
181class IntQTQueryPipe : public QWidget {
182 Q_OBJECT
183public:
184 IntQTQueryPipe(int *_content, QTDialog *_dialog);
185 virtual ~IntQTQueryPipe();
186
187public slots:
188 void update(int);
189
190private:
191 int *content;
192 QTDialog *dialog;
193
194};
195
196class DoubleQTQueryPipe : public QWidget {
197 Q_OBJECT
198public:
199 DoubleQTQueryPipe(double *_content, QTDialog *_dialog);
200 virtual ~DoubleQTQueryPipe();
201
202public slots:
203 void update(double);
204
205private:
206 double *content;
207 QTDialog *dialog;
208
209};
210
211class MoleculeQTQueryPipe : public QWidget {
212 Q_OBJECT
213public:
214 MoleculeQTQueryPipe(molecule **_content, QTDialog *_dialog, QComboBox *_theBox);
215 virtual ~MoleculeQTQueryPipe();
216
217public slots:
218 void update(int);
219
220private:
221 molecule **content;
222 QTDialog *dialog;
223 QComboBox *theBox;
224
225};
226
227class ElementQTQueryPipe : public QWidget {
228 Q_OBJECT
229public:
230 ElementQTQueryPipe(std::vector<element *> *_content, QTDialog *_dialog, QComboBox *_theBox);
231 virtual ~ElementQTQueryPipe();
232
233public slots:
234 void update(int);
235
236private:
237 std::vector<element *> *content;
238 QTDialog *dialog;
239 QComboBox *theBox;
240};
241#endif /* QTDIALOG_HPP_ */
Note: See TracBrowser for help on using the repository browser.