Changeset 4a2f3e for src/UIElements/Views/Qt4
- 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:
- 7772aa
- Parents:
- 4f7473
- git-author:
- Michael Ankele <ankele@…> (06/19/12 13:46:00)
- 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
r4f7473 r4a2f3e 34 34 QtMoleculeView::QtMoleculeView() : 35 35 QTabWidget(), 36 curAtom(NULL), nextAtom(NULL), 36 37 page_mol(NULL), page_atom(NULL) 37 38 { 38 /*allPage = new QTAllMoleculePage();39 addTab(allPage,QString("All Molecules"));39 timer = new QTimer(this); 40 timer->setSingleShot(true); 40 41 41 connect(this,SIGNAL(addMolecule(molecule*)),allPage,SLOT(addMolecule(molecule*))); 42 connect(this,SIGNAL(removeMolecule(molecule*)),allPage,SLOT(removeMolecule(molecule*)));*/ 42 connect(timer, SIGNAL(timeout()), this, SLOT(timerTimeout())); 43 43 } 44 44 … … 46 46 {} 47 47 48 /*void QtMoleculeView::moleculeSelected(molecule *mol){49 if(!pages.count(mol)){50 string molName = mol->name;51 QTMoleculePage *molPage = new QTMoleculePage(mol,molName);52 addTab(molPage,QString(molName.c_str()));53 pages[mol] = molPage;54 55 connect(molPage,SIGNAL(nameChanged(QTMoleculePage*,std::string)),this,SLOT(nameChanged(QTMoleculePage*,std::string)));56 57 emit addMolecule(mol);58 }59 }60 61 void QtMoleculeView::moleculeUnSelected(molecule *mol){62 if(pages.count(mol)){63 QTMoleculePage *molPage = pages[mol];64 removeTab(indexOf(molPage));65 pages.erase(mol);66 delete molPage;67 emit removeMolecule(mol);68 }69 }70 71 void QtMoleculeView::nameChanged(QTMoleculePage *page, std::string name){72 setTabText(indexOf(page),QString(name.c_str()));73 }*/74 75 48 void QtMoleculeView::nameChanged(QTMoleculePage *page, std::string name){} 76 49 77 50 void QtMoleculeView::atomHover(const atom *_atom) 78 51 { 52 nextAtom = _atom; 53 timer->start(500); 54 } 55 56 void QtMoleculeView::timerTimeout() 57 { 58 if (nextAtom) 59 showAtom(nextAtom); 60 } 61 62 void QtMoleculeView::showAtom(const atom *_atom) 63 { 64 curAtom = _atom; 65 79 66 // Remove old tabs. 80 67 if (page_atom){ … … 91 78 92 79 // Show new tabs. 93 if ( _atom){94 page_atom = new QTAtomPage( _atom);80 if (curAtom){ 81 page_atom = new QTAtomPage(curAtom); 95 82 addTab(page_atom, "Atom"); 96 83 97 page_mol = new QTMoleculePage( _atom->getMolecule());84 page_mol = new QTMoleculePage(curAtom->getMolecule()); 98 85 addTab(page_mol, "Molecule"); 99 86 } -
src/UIElements/Views/Qt4/QtMoleculeView.hpp
r4f7473 r4a2f3e 18 18 #include <QtGui/QTabWidget> 19 19 #include <QtGui/QTreeWidget> 20 #include <QTimer> 20 21 #include "CodePatterns/Observer/Observer.hpp" 21 22 … … 34 35 virtual ~QtMoleculeView(); 35 36 37 void showAtom(const atom *_atom); 38 36 39 public slots: 37 40 void atomHover(const atom *_atom); 41 void timerTimeout(); 38 42 39 43 void nameChanged(QTMoleculePage *page, std::string name); 40 44 41 45 private: 46 const atom *curAtom; 47 const atom *nextAtom; 42 48 QTMoleculePage *page_mol; 43 49 QTAtomPage *page_atom; 50 51 QTimer *timer; 44 52 }; 45 53
Note:
See TracChangeset
for help on using the changeset viewer.