Changeset cd8e55 for src/UIElements/QT4
- Timestamp:
- Jul 2, 2010, 1:05:08 PM (15 years ago)
- Branches:
- 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
- Children:
- 4a611e
- Parents:
- edb454
- Location:
- src/UIElements/QT4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/QT4/QTDialog.cpp
redb454 rcd8e55 113 113 } 114 114 115 void QTDialog::queryStrings(const char* title, std::vector<std::string> *target,string) 116 { 117 registerQuery(new StringsQTQuery(title,target,inputLayout,this)); 118 } 119 115 120 void QTDialog::queryMolecule(const char *title,molecule **target,string) 116 121 { … … 210 215 { 211 216 return tmp!=""; 217 } 218 219 QTDialog::StringsQTQuery::StringsQTQuery(string _title,vector<string> *_target,QBoxLayout *_parent,QTDialog *_dialog) : 220 Dialog::StringsQuery(_title,_target), 221 parent(_parent) 222 { 223 thisLayout = new QHBoxLayout(); 224 titleLabel = new QLabel(QString(getTitle().c_str())); 225 inputBox = new QLineEdit(); 226 parent->addLayout(thisLayout); 227 thisLayout->addWidget(titleLabel); 228 thisLayout->addWidget(inputBox); 229 230 pipe = new StringQTQueryPipe(&temp,_dialog); 231 pipe->update(inputBox->text()); 232 connect(inputBox,SIGNAL(textChanged(const QString&)),pipe,SLOT(update(const QString&))); 233 } 234 235 QTDialog::StringsQTQuery::~StringsQTQuery() 236 { 237 delete pipe; 238 } 239 240 // All values besides the empty string are valid 241 bool QTDialog::StringsQTQuery::handle() 242 { 243 // dissect by "," 244 string::iterator olditer = temp.begin(); 245 for(string::iterator iter = temp.begin(); iter != temp.end(); ++iter) { 246 if (*iter == ' ') { 247 tmp.push_back(string(iter, olditer)); 248 olditer = iter; 249 } 250 } 251 if (olditer != temp.begin()) // insert last part also 252 tmp.push_back(string(olditer, temp.end())); 253 254 return temp!=""; 212 255 } 213 256 -
src/UIElements/QT4/QTDialog.hpp
redb454 rcd8e55 40 40 virtual void queryDouble(const char*,double *,std::string = ""); 41 41 virtual void queryString(const char*, std::string *,std::string = ""); 42 virtual void queryStrings(const char*, std::vector<std::string> *,std::string = ""); 42 43 virtual void queryAtom(const char*,atom**,std::string = ""); 43 44 virtual void queryMolecule(const char*,molecule**,std::string = ""); … … 93 94 }; 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 95 110 class MoleculeQTQuery : public Dialog::MoleculeQuery { 96 111 public:
Note:
See TracChangeset
for help on using the changeset viewer.