Changeset 743eab for src/UIElements
- Timestamp:
- Apr 18, 2016, 10:33:41 PM (9 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:
- bff202
- Parents:
- b65879
- git-author:
- Frederik Heber <heber@…> (03/21/16 19:56:27)
- git-committer:
- Frederik Heber <heber@…> (04/18/16 22:33:41)
- Location:
- src/UIElements/Views/Qt4/MoleculeList
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Views/Qt4/MoleculeList/QtMoleculeList.cpp
rb65879 r743eab 87 87 connect(&observer, SIGNAL(NameChanged(const QtObservedMolecule::ptr)), 88 88 this, SLOT(nameChanged(const QtObservedMolecule::ptr))); 89 connect(&observer, SIGNAL(AtomCountChanged(const QtObservedMolecule::ptr)), 90 this, SLOT(atomcountChanged(const QtObservedMolecule::ptr))); 89 91 connect(board, SIGNAL(moleculeIndexChanged(const moleculeId_t,const moleculeId_t)), 90 92 this, SLOT(moleculeIndexChanged(const moleculeId_t, const moleculeId_t))); … … 573 575 void QtMoleculeList::formulaChanged(const QtObservedMolecule::ptr _mol) 574 576 { 575 // we need the id as identifier to the item s577 // we need the id as identifier to the item 576 578 const moleculeId_t molid = _mol->getMolIndex(); 579 LOG(3, "DEBUG: QtMoleculeList got formulaChanged for id " << molid); 580 QtMoleculeItem *const molitem = MoleculeIdToItem(molid); 581 // update item 582 { 583 QtMoleculeItem *const formulaitem = getSpecificMoleculeItem(molitem, QtMoleculeItem::FORMULA); 584 ASSERT(formulaitem != NULL, 585 "QtMoleculeList::formulaChanged() - could not item for FORMULA."); 586 formulaitem->updateState(_mol); 587 } 588 577 589 LOG(3, "DEBUG: Moving item to id " << molid); 578 590 const MoleculeFormulaMap_t::iterator formulaiter = … … 587 599 // then we move the item if necessary 588 600 if (old_formula != new_formula) { 589 QtMoleculeItem *const molitem = MoleculeIdToItem(molid);590 // update items591 getSpecificMoleculeItem(molitem, QtMoleculeItem::FORMULA)->updateState(_mol);592 getSpecificMoleculeItem(molitem, QtMoleculeItem::ATOMCOUNT)->updateState(_mol);593 601 LOG(3, "DEBUG: Moving item " << molitem); 594 602 // remove from formula<->molecule bimap with old formula … … 612 620 } 613 621 614 void QtMoleculeList:: nameChanged(const QtObservedMolecule::ptr _mol)622 void QtMoleculeList::atomcountChanged(const QtObservedMolecule::ptr _mol) 615 623 { 616 624 // we need the id as identifier to the items 617 625 const moleculeId_t molid = _mol->getMolIndex(); 618 // nothing to do, item updates itself 619 LOG(3, "DEBUG: QtMoleculeList got nameChangd for id " << molid); 626 LOG(3, "DEBUG: QtMoleculeList got atomcountChanged for id " << molid); 620 627 QtMoleculeItem *const molitem = MoleculeIdToItem(molid); 621 628 // update items 622 getSpecificMoleculeItem(molitem, QtMoleculeItem::NAME)->updateState(_mol); 623 } 629 QtMoleculeItem *const atomcountitem = getSpecificMoleculeItem(molitem, QtMoleculeItem::ATOMCOUNT); 630 ASSERT(atomcountitem != NULL, 631 "QtMoleculeList::atomcountChanged() - could not item for ATOMCOUNT."); 632 atomcountitem->updateState(_mol); 633 } 634 635 void QtMoleculeList::nameChanged(const QtObservedMolecule::ptr _mol) 636 { 637 // we need the id as identifier to the items 638 const moleculeId_t molid = _mol->getMolIndex(); 639 LOG(3, "DEBUG: QtMoleculeList got nameChanged for id " << molid); 640 QtMoleculeItem *const molitem = MoleculeIdToItem(molid); 641 // update items 642 QtMoleculeItem *const nameitem = getSpecificMoleculeItem(molitem, QtMoleculeItem::NAME); 643 ASSERT(nameitem != NULL, 644 "QtMoleculeList::nameChanged() - could not item for NAME."); 645 nameitem->updateState(_mol); 646 } -
src/UIElements/Views/Qt4/MoleculeList/QtMoleculeList.hpp
rb65879 r743eab 50 50 void formulaChanged(const QtObservedMolecule::ptr _mol); 51 51 void nameChanged(const QtObservedMolecule::ptr _mol); 52 void atomcountChanged(const QtObservedMolecule::ptr _mol); 52 53 53 54 void moleculeNameChanged(QStandardItem*); … … 55 56 56 57 signals: 57 void moleculeSelected(const QtObservedMolecule::ptr _mol);58 void moleculeUnSelected(const QtObservedMolecule::ptr _mol);59 58 void moleculesVisibilityChanged(const moleculeId_t, bool); 60 61 private:62 59 63 60 private slots: -
src/UIElements/Views/Qt4/MoleculeList/QtObservedMoleculeObserver.cpp
rb65879 r743eab 53 53 void QtObservedMoleculeObserver::moleculeInserted(const QtObservedMolecule::ptr _molecule) 54 54 { 55 connect( _molecule.get(), SIGNAL(atomcountChanged()), this, SLOT(atomcountChanged())); 55 56 connect( _molecule.get(), SIGNAL(formulaChanged()), this, SLOT(formulaChanged())); 56 57 connect( _molecule.get(), SIGNAL(nameChanged()), this, SLOT(nameChanged())); 58 connect( _molecule.get(), SIGNAL(selectedChanged()), this, SLOT(selectionChanged())); 57 59 emit MoleculeInserted(_molecule); 58 60 } … … 61 63 { 62 64 const QtObservedMolecule::ptr mol = board->getObservedMolecule(_moleculeid); 65 disconnect( mol.get(), SIGNAL(atomcountChanged()), this, SLOT(atomcountChanged())); 63 66 disconnect( mol.get(), SIGNAL(formulaChanged()), this, SLOT(formulaChanged())); 64 67 disconnect( mol.get(), SIGNAL(nameChanged()), this, SLOT(nameChanged())); 68 disconnect( mol.get(), SIGNAL(selectedChanged()), this, SLOT(selectionChanged())); 65 69 emit MoleculeRemoved(_moleculeid); 70 } 71 72 void QtObservedMoleculeObserver::atomcountChanged() 73 { 74 QtObservedMolecule * const mol = static_cast<QtObservedMolecule *>(sender()); 75 emit AtomCountChanged(mol->getRef()); 66 76 } 67 77 … … 77 87 emit NameChanged(mol->getRef()); 78 88 } 89 90 void QtObservedMoleculeObserver::selectionChanged() 91 { 92 QtObservedMolecule * const mol = static_cast<QtObservedMolecule *>(sender()); 93 emit SelectionChanged(mol->getRef()); 94 } 95 -
src/UIElements/Views/Qt4/MoleculeList/QtObservedMoleculeObserver.hpp
rb65879 r743eab 38 38 39 39 signals: 40 void AtomCountChanged(const QtObservedMolecule::ptr _molecule); 40 41 void FormulaChanged(const QtObservedMolecule::ptr _molecule); 41 42 void NameChanged(const QtObservedMolecule::ptr _molecule); 43 void SelectionChanged(const QtObservedMolecule::ptr _molecule); 42 44 43 45 // relayed signals … … 47 49 private slots: 48 50 // relayed, and modified signals 51 void atomcountChanged(); 49 52 void formulaChanged(); 50 53 void nameChanged(); 54 void selectionChanged(); 51 55 52 56 void moleculeInserted(const QtObservedMolecule::ptr _molecule);
Note:
See TracChangeset
for help on using the changeset viewer.