Changeset 257c77 for src/UIElements/QT4
- Timestamp:
- Jun 17, 2010, 2:55:56 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:
- b47bfc
- Parents:
- 992fd7 (diff), 5f5a7b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src/UIElements/QT4
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/QT4/QTDialog.cpp
r992fd7 r257c77 21 21 #include <Qt/qcombobox.h> 22 22 23 #include "Helpers/MemDebug.hpp" 24 23 25 #include "World.hpp" 24 26 #include "periodentafel.hpp" … … 26 28 #include "element.hpp" 27 29 #include "molecule.hpp" 28 #include " Helpers/MemDebug.hpp"30 #include "Descriptors/MoleculeIdDescriptor.hpp" 29 31 30 32 … … 76 78 /************************** Query Infrastructure ************************/ 77 79 78 void QTDialog::queryInt(const char *title, int *target) 80 void QTDialog::queryEmpty(char const*, string){ 81 // TODO 82 ASSERT(false, "Not implemented yet"); 83 } 84 85 void QTDialog::queryBoolean(char const*, bool*,string){ 86 // TODO 87 ASSERT(false, "Not implemented yet"); 88 } 89 90 void QTDialog::queryAtom(char const*, atom**, string){ 91 // TODO 92 ASSERT(false, "Not implemented yet"); 93 } 94 95 void QTDialog::queryBox(char const*, double**, string){ 96 // TODO 97 ASSERT(false, "Not implemented yet"); 98 } 99 100 101 void QTDialog::queryInt(const char *title, int *target,string) 79 102 { 80 103 registerQuery(new IntQTQuery(title,target,inputLayout,this)); 81 104 } 82 105 83 void QTDialog::queryDouble(const char* title, double* target ){106 void QTDialog::queryDouble(const char* title, double* target,string){ 84 107 registerQuery(new DoubleQTQuery(title,target,inputLayout,this)); 85 108 } 86 109 87 void QTDialog::queryString(const char* title, std::string *target )110 void QTDialog::queryString(const char* title, std::string *target,string) 88 111 { 89 112 registerQuery(new StringQTQuery(title,target,inputLayout,this)); 90 113 } 91 114 92 void QTDialog::queryMolecule(const char *title,molecule **target, MoleculeListClass *molecules)93 { 94 registerQuery(new MoleculeQTQuery(title,target, molecules,inputLayout,this));95 } 96 97 void QTDialog::queryVector(const char* title, Vector *target,const double *const cellSize, bool check ) {115 void QTDialog::queryMolecule(const char *title,molecule **target,string) 116 { 117 registerQuery(new MoleculeQTQuery(title,target,inputLayout,this)); 118 } 119 120 void QTDialog::queryVector(const char* title, Vector *target,const double *const cellSize, bool check,string) { 98 121 registerQuery(new VectorQTQuery(title,target,cellSize,check,inputLayout,this)); 99 122 } 100 123 101 void QTDialog::queryElement(const char* title, const element **target){124 void QTDialog::queryElement(const char* title, std::vector<element *> *target,string){ 102 125 registerQuery(new ElementQTQuery(title,target,inputLayout,this)); 103 126 } … … 189 212 } 190 213 191 QTDialog::MoleculeQTQuery::MoleculeQTQuery(string _title, molecule **_target, MoleculeListClass *_molecules, QBoxLayout *_parent,QTDialog *_dialog) : 192 Dialog::MoleculeQuery(_title,_target,_molecules), 193 parent(_parent) 194 { 195 MoleculeList::iterator iter; 214 QTDialog::MoleculeQTQuery::MoleculeQTQuery(string _title, molecule **_target, QBoxLayout *_parent,QTDialog *_dialog) : 215 Dialog::MoleculeQuery(_title,_target), 216 parent(_parent) 217 { 196 218 thisLayout = new QHBoxLayout(); 197 219 titleLabel = new QLabel(QString(getTitle().c_str())); 198 220 inputBox = new QComboBox(); 199 221 // add all molecules to the combo box 200 for(iter = molecules->ListOfMolecules.begin(); 201 iter != molecules->ListOfMolecules.end(); 222 vector<molecule*> molecules = World::getInstance().getAllMolecules(); 223 for(vector<molecule*>::iterator iter = molecules.begin(); 224 iter != molecules.end(); 202 225 ++iter) { 203 226 stringstream sstr; … … 209 232 thisLayout->addWidget(inputBox); 210 233 211 pipe = new MoleculeQTQueryPipe(&tmp,_dialog,inputBox ,_molecules);234 pipe = new MoleculeQTQueryPipe(&tmp,_dialog,inputBox); 212 235 pipe->update(inputBox->currentIndex()); 213 236 connect(inputBox,SIGNAL(currentIndexChanged(int)),pipe,SLOT(update(int))); … … 263 286 264 287 265 QTDialog::ElementQTQuery::ElementQTQuery(std::string _title, const element **_target, QBoxLayout *_parent, QTDialog *_dialog) :288 QTDialog::ElementQTQuery::ElementQTQuery(std::string _title, vector<element *> *_target, QBoxLayout *_parent, QTDialog *_dialog) : 266 289 Dialog::ElementQuery(_title,_target), 267 290 parent(_parent) … … 283 306 thisLayout->addWidget(inputBox); 284 307 285 pipe = new ElementQTQueryPipe(& tmp,_dialog,inputBox);308 pipe = new ElementQTQueryPipe(&elements,_dialog,inputBox); 286 309 pipe->update(inputBox->currentIndex()); 287 310 connect(inputBox,SIGNAL(currentIndexChanged(int)),pipe,SLOT(update(int))); … … 338 361 } 339 362 340 MoleculeQTQueryPipe::MoleculeQTQueryPipe(molecule **_content, QTDialog *_dialog, QComboBox *_theBox , MoleculeListClass *_molecules) :363 MoleculeQTQueryPipe::MoleculeQTQueryPipe(molecule **_content, QTDialog *_dialog, QComboBox *_theBox) : 341 364 content(_content), 342 365 dialog(_dialog), 343 theBox(_theBox), 344 molecules(_molecules) 366 theBox(_theBox) 345 367 {} 346 368 … … 351 373 QVariant data = theBox->itemData(newIndex); 352 374 int idx = data.toInt(); 353 (*content) = molecules->ReturnIndex(idx);354 dialog->update(); 355 } 356 357 ElementQTQueryPipe::ElementQTQueryPipe( const element **_content, QTDialog *_dialog, QComboBox *_theBox) :375 (*content) = World::getInstance().getMolecule(MoleculeById(idx)); 376 dialog->update(); 377 } 378 379 ElementQTQueryPipe::ElementQTQueryPipe(std::vector<element *> *_content, QTDialog *_dialog, QComboBox *_theBox) : 358 380 content(_content), 359 381 dialog(_dialog), 360 382 theBox(_theBox) 361 {} 383 { 384 content->resize(1); 385 } 362 386 363 387 ElementQTQueryPipe::~ElementQTQueryPipe() … … 367 391 QVariant data = theBox->itemData(newIndex); 368 392 int idx = data.toInt(); 369 (*content) = World::getInstance().getPeriode()->FindElement(idx);370 dialog->update(); 371 } 372 393 (*content)[0] = World::getInstance().getPeriode()->FindElement(idx); 394 dialog->update(); 395 } 396 -
src/UIElements/QT4/QTDialog.hpp
r992fd7 r257c77 35 35 virtual ~QTDialog(); 36 36 37 virtual void queryInt(const char *, int *); 38 virtual void queryString(const char*, std::string *); 39 virtual void queryDouble(const char*,double *); 40 virtual void queryMolecule(const char*,molecule**,MoleculeListClass*); 41 virtual void queryVector(const char*,Vector *,const double *const,bool); 42 virtual void queryElement(const char*,const element **); 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 = ""); 44 virtual void queryVector(const char*,Vector *,const double *const,bool,std::string = ""); 45 virtual void queryBox(const char*,double ** const, std::string = ""); 46 virtual void queryElement(const char*,std::vector<element *> *_target,std::string = ""); 43 47 44 48 virtual bool display(); … … 91 95 class MoleculeQTQuery : public Dialog::MoleculeQuery { 92 96 public: 93 MoleculeQTQuery(std::string _title, molecule **_target, MoleculeListClass *_molecules,QBoxLayout *_parent,QTDialog *_dialog);97 MoleculeQTQuery(std::string _title, molecule **_target, QBoxLayout *_parent,QTDialog *_dialog); 94 98 virtual ~MoleculeQTQuery(); 95 99 virtual bool handle(); … … 122 126 class ElementQTQuery : public Dialog::ElementQuery { 123 127 public: 124 ElementQTQuery(std::string _title, const element **_target, QBoxLayout *_parent, QTDialog *_dialog);128 ElementQTQuery(std::string _title, std::vector<element *> *_target, QBoxLayout *_parent, QTDialog *_dialog); 125 129 virtual ~ElementQTQuery(); 126 130 virtual bool handle(); … … 193 197 Q_OBJECT 194 198 public: 195 MoleculeQTQueryPipe(molecule **_content, QTDialog *_dialog, QComboBox *_theBox , MoleculeListClass *_molecules);199 MoleculeQTQueryPipe(molecule **_content, QTDialog *_dialog, QComboBox *_theBox); 196 200 virtual ~MoleculeQTQueryPipe(); 197 201 … … 201 205 private: 202 206 molecule **content; 203 MoleculeListClass *molecules;204 207 QTDialog *dialog; 205 208 QComboBox *theBox; … … 210 213 Q_OBJECT 211 214 public: 212 ElementQTQueryPipe( const element **_content, QTDialog *_dialog, QComboBox *_theBox);215 ElementQTQueryPipe(std::vector<element *> *_content, QTDialog *_dialog, QComboBox *_theBox); 213 216 virtual ~ElementQTQueryPipe(); 214 217 … … 217 220 218 221 private: 219 const element **content;222 std::vector<element *> *content; 220 223 QTDialog *dialog; 221 224 QComboBox *theBox; -
src/UIElements/QT4/QTMainWindow.cpp
r992fd7 r257c77 29 29 using namespace std; 30 30 31 QTMainWindow::QTMainWindow( menuPopulaters populaters,MoleculeListClass *molecules, config *configuration, periodentafel *periode, char *ConfigFileName,QApplication *_theApp) :31 QTMainWindow::QTMainWindow(QApplication *_theApp) : 32 32 theApp(_theApp) 33 33 { … … 35 35 QSplitter *splitter2 = new QSplitter (Qt::Vertical, splitter1 ); 36 36 37 worldDisplay = new QTWorldView( molecules,splitter2);37 worldDisplay = new QTWorldView(splitter2); 38 38 39 39 moleculeDisplay = new QTMoleculeView(); … … 48 48 statusBar = new QTStatusBar(this); 49 49 setStatusBar(statusBar); 50 51 editMoleculesMenu = new QTMenu("Edit Molecules");52 populaters.MakeEditMoleculesMenu(editMoleculesMenu,molecules,configuration,periode);53 menuBar()->addMenu(editMoleculesMenu);54 50 55 51 connect(worldDisplay,SIGNAL(moleculeSelected(molecule*)),moleculeDisplay,SLOT(moleculeSelected(molecule*))); -
src/UIElements/QT4/QTMainWindow.hpp
r992fd7 r257c77 24 24 25 25 public: 26 QTMainWindow(menuPopulaters populaters,MoleculeListClass *molecules, config *configuration, 27 periodentafel *periode, char *ConfigFileName, QApplication *_theApp); 26 QTMainWindow(QApplication *_theApp); 28 27 virtual ~QTMainWindow(); 29 28 -
src/UIElements/QT4/QTUIFactory.cpp
r992fd7 r257c77 41 41 } 42 42 43 MainWindow* QTUIFactory::makeMainWindow( menuPopulaters populaters,MoleculeListClass *molecules, config *configuration, periodentafel *periode, char *ConfigFileName) {44 return new QTMainWindow( populaters,molecules,configuration,periode,ConfigFileName,app);43 MainWindow* QTUIFactory::makeMainWindow() { 44 return new QTMainWindow(app); 45 45 } 46 46 -
src/UIElements/QT4/QTUIFactory.hpp
r992fd7 r257c77 21 21 22 22 virtual Dialog* makeDialog(); 23 virtual MainWindow* makeMainWindow( menuPopulaters,MoleculeListClass *, config *, periodentafel *, char *);23 virtual MainWindow* makeMainWindow(); 24 24 25 25 struct description : public UIFactory::factoryDescription {
Note:
See TracChangeset
for help on using the changeset viewer.