source: src/UIElements/QT4/QTDialog.hpp@ 63b56a7

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

Merge branch 'MenuRefactoring' into QT4Refactoring

Conflicts:

molecuilder/src/Actions/Process.cpp
molecuilder/src/Actions/Process.hpp
molecuilder/src/Actions/small_actions.hpp
molecuilder/src/Makefile.am
molecuilder/src/UIElements/TextDialog.cpp
molecuilder/src/World.cpp
molecuilder/src/unittests/Makefile.am

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