source: src/UIElements/QT4/QTDialog.hpp@ 36166d

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 36166d was 5ec8e3, checked in by Tillmann Crueger <crueger@…>, 15 years ago

Merge branch 'VectorRefactoring' into StructureRefactoring

Conflicts:

molecuilder/src/Makefile.am

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