Changeset ee62e4 for src/UIElements


Ignore:
Timestamp:
Oct 24, 2010, 8:24:01 PM (14 years ago)
Author:
Frederik Heber <heber@…>
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
Message:

Added BooleanQTQuery.

Location:
src/UIElements/QT4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/QT4/QTDialog.cpp

    r9d457d ree62e4  
    103103}
    104104
    105 void QTDialog::queryBoolean(const char*,string){
    106   // TODO
    107   ASSERT(false, "Not implemented yet");
     105void QTDialog::queryBoolean(const char* title,string)
     106{
     107  registerQuery(new BooleanQTQuery(title,inputLayout,this));
    108108}
    109109
     
    655655
    656656
     657QTDialog::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
     674QTDialog::BooleanQTQuery::~BooleanQTQuery()
     675{
     676  delete pipe;
     677}
     678
     679bool QTDialog::BooleanQTQuery::handle(){
     680  return true;
     681}
     682
     683
    657684QTDialog::FileQTQuery::FileQTQuery(std::string _title, QBoxLayout *_parent, QTDialog *_dialog) :
    658685    Dialog::FileQuery(_title),
     
    941968}
    942969
     970BooleanQTQueryPipe::BooleanQTQueryPipe(const bool *_content, QTDialog *_dialog, QComboBox *_booleanComboBox) :
     971  content(_content),
     972  dialog(_dialog),
     973  booleanComboBox(_booleanComboBox)
     974{}
     975
     976BooleanQTQueryPipe::~BooleanQTQueryPipe()
     977{}
     978
     979void BooleanQTQueryPipe::update() {
     980  dialog->update();
     981}
     982
    943983FileQTQueryPipe::FileQTQueryPipe(boost::filesystem::path *_content, QTDialog *_dialog, QLineEdit *_filenameLineEdit, QPushButton *_filedialogButton) :
    944984  content(_content),
  • src/UIElements/QT4/QTDialog.hpp

    r9d457d ree62e4  
    2727// Forward declarations for plumbing
    2828template<typename T> class QTQueryListPipe;
     29class BooleanQTQueryPipe;
    2930class StringQTQueryPipe;
    3031class StringsQTQueryPipe;
     
    264265    };
    265266
     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
    266281    class ElementQTQuery : public Dialog::ElementQuery {
    267282    public:
     
    496511};
    497512
     513class BooleanQTQueryPipe : public QWidget {
     514  Q_OBJECT
     515public:
     516  BooleanQTQueryPipe(const bool *_content, QTDialog *_dialog, QComboBox *_booleanComboBox);
     517  virtual ~BooleanQTQueryPipe();
     518
     519public slots:
     520  void update();
     521
     522private:
     523  const bool *content;
     524  QTDialog *dialog;
     525  QComboBox *booleanComboBox;
     526};
     527
    498528class ElementQTQueryPipe : public QWidget {
    499529  Q_OBJECT
Note: See TracChangeset for help on using the changeset viewer.