source: src/UIElements/Qt4/QtDialog.cpp@ 12948c

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 12948c was 12948c, checked in by Frederik Heber <heber@…>, 13 years ago

Added new Query for std::vector of unsigned int.

  • this is preparatory to make selection rectangle possible.
  • Property mode set to 100644
File size: 4.8 KB
Line 
1/*
2 * Project: MoleCuilder
3 * Description: creates and alters molecular systems
4 * Copyright (C) 2010 University of Bonn. All rights reserved.
5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
6 */
7
8/*
9 * QtDialog.cpp
10 *
11 * Created on: Jan 18, 2010
12 * Author: crueger
13 */
14
15// include config.h
16#ifdef HAVE_CONFIG_H
17#include <config.h>
18#endif
19
20#include "UIElements/Qt4/QtDialog.hpp"
21#include "UIElements/Qt4/Query/QtQuery.hpp"
22
23#include <QtGui/QDialogButtonBox>
24#include <Qt/qpushbutton.h>
25#include <Qt/qboxlayout.h>
26
27#include "CodePatterns/MemDebug.hpp"
28
29
30using namespace std;
31
32QtDialog::QtDialog() :
33 QDialog(0)
34{
35 // creating and filling of the Dialog window
36 mainLayout = new QVBoxLayout();
37 inputLayout = new QVBoxLayout();
38 buttonLayout = new QVBoxLayout();
39 setLayout(mainLayout);
40 mainLayout->addLayout(inputLayout);
41 mainLayout->addLayout(buttonLayout);
42 buttons = new QDialogButtonBox(QDialogButtonBox::Ok| QDialogButtonBox::Cancel);
43 buttonLayout->addWidget(buttons);
44
45 // Disable the ok button until something was entered
46 buttons->button(QDialogButtonBox::Ok)->setEnabled(false);
47
48 // connect the buttons to their appropriate slots
49 connect(buttons, SIGNAL(accepted()), this, SLOT(accept()));
50 connect(buttons, SIGNAL(rejected()), this, SLOT(reject()));
51}
52
53QtDialog::~QtDialog()
54{
55}
56
57bool QtDialog::display(){
58 // Button state might have changed by some update that
59 // was done during query construction. To make sure
60 // the state is correct, we just call update one more time.
61 update();
62 if(exec()) {
63 setAll();
64 return true;
65 }
66 else {
67 return false;
68 }
69}
70
71void QtDialog::update(){
72 buttons->button(QDialogButtonBox::Ok)->setEnabled(checkAll());
73}
74
75/************************** Query Infrastructure ************************/
76
77void QtDialog::queryEmpty(const char* title, std::string)
78{
79 registerQuery(new EmptyQtQuery(title,inputLayout,this));
80}
81
82void QtDialog::queryBoolean(const char* title,string)
83{
84 registerQuery(new BooleanQtQuery(title,inputLayout,this));
85}
86
87void QtDialog::queryAtom(const char* title, std::string)
88{
89 registerQuery(new AtomQtQuery(title,inputLayout,this));
90}
91
92void QtDialog::queryAtoms(const char* title, std::string)
93{
94 registerQuery(new AtomsQtQuery(title,inputLayout,this));
95}
96
97void QtDialog::queryBox(const char* title, std::string)
98{
99 registerQuery(new BoxQtQuery(title,inputLayout,this));
100}
101
102void QtDialog::queryInt(const char *title,string)
103{
104 registerQuery(new IntQtQuery(title,inputLayout,this));
105}
106
107void QtDialog::queryInts(const char *title,string)
108{
109 registerQuery(new IntsQtQuery(title,inputLayout,this));
110}
111
112void QtDialog::queryUnsignedInt(const char *title,string)
113{
114 registerQuery(new UnsignedIntQtQuery(title,inputLayout,this));
115}
116
117void QtDialog::queryUnsignedInts(const char *title,string)
118{
119 registerQuery(new UnsignedIntsQtQuery(title,inputLayout,this));
120}
121
122void QtDialog::queryDouble(const char* title,string)
123{
124 registerQuery(new DoubleQtQuery(title,inputLayout,this));
125}
126
127void QtDialog::queryDoubles(const char* title,string)
128{
129 registerQuery(new DoublesQtQuery(title,inputLayout,this));
130}
131
132void QtDialog::queryString(const char* title,string)
133{
134 registerQuery(new StringQtQuery(title,inputLayout,this));
135}
136
137void QtDialog::queryStrings(const char* title,string)
138{
139 registerQuery(new StringsQtQuery(title,inputLayout,this));
140}
141
142void QtDialog::queryMolecule(const char *title,string)
143{
144 registerQuery(new MoleculeQtQuery(title,inputLayout,this));
145}
146
147void QtDialog::queryMolecules(const char *title,string)
148{
149 registerQuery(new MoleculesQtQuery(title,inputLayout,this));
150}
151
152void QtDialog::queryVector(const char* title, bool check,string)
153{
154 registerQuery(new VectorQtQuery(title,check,inputLayout,this));
155}
156
157void QtDialog::queryVectors(const char* title, bool check,string)
158{
159 registerQuery(new VectorsQtQuery(title,check,inputLayout,this));
160}
161
162void QtDialog::queryElement(const char* title, std::string)
163{
164 registerQuery(new ElementQtQuery(title,inputLayout,this));
165}
166
167void QtDialog::queryElements(const char* title, std::string)
168{
169 registerQuery(new ElementsQtQuery(title,inputLayout,this));
170}
171
172void QtDialog::queryFile(const char* title, std::string)
173{
174 registerQuery(new FileQtQuery(title,inputLayout,this));
175}
176
177void QtDialog::queryRandomNumberDistribution_Parameters(const char* title, std::string)
178{
179 registerQuery(new RandomNumberDistribution_ParametersQtQuery(title,inputLayout,this));
180}
181
182/************************** Query Infrastructure ************************/
183/* ---> shifted to folder Query */
184/************************************************************************/
185
186/*************************** Pipe Infrastructure ************************/
187/* ---> shifted to folder Pipe */
188/************************************************************************/
Note: See TracBrowser for help on using the repository browser.