Changeset be374a
- Timestamp:
- Jul 17, 2012, 12:17:28 PM (13 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:
- c736fe
- Parents:
- 7772aa
- git-author:
- Michael Ankele <ankele@…> (06/29/12 15:25:34)
- git-committer:
- Michael Ankele <ankele@…> (07/17/12 12:17:28)
- Location:
- src/UIElements/Views/Qt4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Views/Qt4/QtMoleculeView.cpp
r7772aa rbe374a 44 44 45 45 QtMoleculeView::~QtMoleculeView() 46 {} 46 { 47 clearTabs(); 48 } 47 49 48 50 void QtMoleculeView::nameChanged(QTMoleculePage *page, std::string name){} … … 60 62 } 61 63 62 void QtMoleculeView:: showAtom(const atom *_atom)64 void QtMoleculeView::clearTabs() 63 65 { 64 curAtom = _atom;65 66 // Remove old tabs.67 66 if (page_atom){ 68 removeTab(indexOf(page_atom));67 //removeTab(indexOf(page_atom)); 69 68 delete(page_atom); 70 69 page_atom = NULL; 71 70 } 72 71 if (page_mol){ 73 removeTab(indexOf(page_mol));72 //removeTab(indexOf(page_mol)); 74 73 delete(page_mol); 75 74 page_mol = NULL; 76 75 } 76 } 77 77 78 void QtMoleculeView::showAtom(const atom *_atom) 79 { 80 // Remove old tabs. 81 clearTabs(); 82 83 curAtom = _atom; 78 84 79 85 // Show new tabs. … … 81 87 page_atom = new QTAtomPage(curAtom); 82 88 addTab(page_atom, "Atom"); 89 connect(page_atom, SIGNAL(atomKilled()), this, SLOT(clearTabs())); 83 90 84 91 if (curAtom->getMolecule()){ 85 92 page_mol = new QTMoleculePage(curAtom->getMolecule()); 86 93 addTab(page_mol, "Molecule"); 94 connect(page_mol, SIGNAL(moleculeKilled()), this, SLOT(clearTabs())); 87 95 } 88 96 } … … 120 128 QTAtomPage::~QTAtomPage() 121 129 { 122 atomRef->signOff(this); 130 if (atomRef) 131 atomRef->signOff(this); 123 132 } 124 133 … … 130 139 } 131 140 132 void QTAtomPage::subjectKilled(Observable *subject){} 141 void QTAtomPage::subjectKilled(Observable *subject){ 142 atomRef = NULL; 143 emit atomKilled(); 144 } 133 145 134 146 /************************ Tab for single Molecules *****************/ … … 154 166 155 167 QTMoleculePage::~QTMoleculePage(){ 156 mol->signOff(this); 168 if (mol) 169 mol->signOff(this); 157 170 } 158 171 159 void QTMoleculePage::update(Observable *subject){ 172 void QTMoleculePage::update(Observable *subject){ std::cout << "tab mol update\n"; 160 173 } 161 174 162 void QTMoleculePage::subjectKilled(Observable *subject){} 175 void QTMoleculePage::subjectKilled(Observable *subject){ 176 mol = NULL; 177 emit moleculeKilled(); 178 } -
src/UIElements/Views/Qt4/QtMoleculeView.hpp
r7772aa rbe374a 42 42 43 43 void nameChanged(QTMoleculePage *page, std::string name); 44 void clearTabs(); 44 45 45 46 private: … … 63 64 void subjectKilled(Observable *subject); 64 65 66 signals: 67 void atomKilled(); 68 65 69 private: 66 70 const atom *atomRef; … … 80 84 void subjectKilled(Observable *subject); 81 85 86 signals: 87 void moleculeKilled(); 88 82 89 private: 83 90 const molecule *mol;
Note:
See TracChangeset
for help on using the changeset viewer.