Changeset ee62e4 for src/UIElements
- Timestamp:
- Oct 24, 2010, 8:24:01 PM (14 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:
- c96c66
- Parents:
- 9d457d
- Location:
- src/UIElements/QT4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/QT4/QTDialog.cpp
r9d457d ree62e4 103 103 } 104 104 105 void QTDialog::queryBoolean(const char* ,string){106 // TODO 107 ASSERT(false, "Not implemented yet");105 void QTDialog::queryBoolean(const char* title,string) 106 { 107 registerQuery(new BooleanQTQuery(title,inputLayout,this)); 108 108 } 109 109 … … 655 655 656 656 657 QTDialog::BooleanQTQuery::BooleanQTQuery(std::string _title, QBoxLayout *_parent, QTDialog *_dialog) : 658 Dialog::BooleanQuery(_title), 659 parent(_parent) 660 { 661 titleLabel = new QLabel(QString(getTitle().c_str()),_dialog); 662 booleanComboBox = new QComboBox(_dialog); 663 booleanComboBox->insertItem(1, QString("true")); 664 booleanComboBox->insertItem(0, QString("false")); 665 666 parent->addLayout(thisLayout); 667 thisLayout->addWidget(titleLabel); 668 thisLayout->addWidget(booleanComboBox); 669 670 pipe = new BooleanQTQueryPipe(&tmp,_dialog,booleanComboBox); 671 connect(booleanComboBox, SIGNAL(currentIndexChanged()), pipe, SLOT(update())); 672 } 673 674 QTDialog::BooleanQTQuery::~BooleanQTQuery() 675 { 676 delete pipe; 677 } 678 679 bool QTDialog::BooleanQTQuery::handle(){ 680 return true; 681 } 682 683 657 684 QTDialog::FileQTQuery::FileQTQuery(std::string _title, QBoxLayout *_parent, QTDialog *_dialog) : 658 685 Dialog::FileQuery(_title), … … 941 968 } 942 969 970 BooleanQTQueryPipe::BooleanQTQueryPipe(const bool *_content, QTDialog *_dialog, QComboBox *_booleanComboBox) : 971 content(_content), 972 dialog(_dialog), 973 booleanComboBox(_booleanComboBox) 974 {} 975 976 BooleanQTQueryPipe::~BooleanQTQueryPipe() 977 {} 978 979 void BooleanQTQueryPipe::update() { 980 dialog->update(); 981 } 982 943 983 FileQTQueryPipe::FileQTQueryPipe(boost::filesystem::path *_content, QTDialog *_dialog, QLineEdit *_filenameLineEdit, QPushButton *_filedialogButton) : 944 984 content(_content), -
src/UIElements/QT4/QTDialog.hpp
r9d457d ree62e4 27 27 // Forward declarations for plumbing 28 28 template<typename T> class QTQueryListPipe; 29 class BooleanQTQueryPipe; 29 30 class StringQTQueryPipe; 30 31 class StringsQTQueryPipe; … … 264 265 }; 265 266 267 class BooleanQTQuery : public Dialog::BooleanQuery { 268 public: 269 BooleanQTQuery(std::string _title, QBoxLayout *_parent, QTDialog *_dialog); 270 virtual ~BooleanQTQuery(); 271 virtual bool handle(); 272 private: 273 QBoxLayout *parent; 274 QBoxLayout *thisLayout; 275 QLabel *titleLabel; 276 QComboBox *booleanComboBox; 277 278 BooleanQTQueryPipe *pipe; 279 }; 280 266 281 class ElementQTQuery : public Dialog::ElementQuery { 267 282 public: … … 496 511 }; 497 512 513 class BooleanQTQueryPipe : public QWidget { 514 Q_OBJECT 515 public: 516 BooleanQTQueryPipe(const bool *_content, QTDialog *_dialog, QComboBox *_booleanComboBox); 517 virtual ~BooleanQTQueryPipe(); 518 519 public slots: 520 void update(); 521 522 private: 523 const bool *content; 524 QTDialog *dialog; 525 QComboBox *booleanComboBox; 526 }; 527 498 528 class ElementQTQueryPipe : public QWidget { 499 529 Q_OBJECT
Note:
See TracChangeset
for help on using the changeset viewer.