Changeset 1de61e for src/UIElements/Views/Qt4
- Timestamp:
- Apr 6, 2012, 11:57:20 AM (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:
- a14fe3
- Parents:
- b14efe
- git-author:
- Michael Ankele <ankele@…> (03/13/12 13:24:27)
- git-committer:
- Frederik Heber <heber@…> (04/06/12 11:57:20)
- Location:
- src/UIElements/Views/Qt4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Views/Qt4/QtElementList.cpp
rb14efe r1de61e 33 33 #include "Descriptors/AtomTypeDescriptor.hpp" 34 34 #include <QAbstractItemView> 35 #include "Actions/SelectionAction/Atoms/AtomByElementAction.hpp" 36 #include "Actions/SelectionAction/Atoms/NotAtomByElementAction.hpp" 35 37 36 38 using namespace std; … … 57 59 update(molecules); 58 60 59 connect(this,SIGNAL( cellClicked(int,int)),this,SLOT(cellSelected(int,int)));61 connect(this,SIGNAL(itemSelectionChanged()),this,SLOT(rowSelected())); 60 62 } 61 63 … … 68 70 69 71 periodentafel *&periode = World::getInstance().getPeriode(); 72 73 elementSelection.clear(); 70 74 71 75 int i; … … 81 85 82 86 QTreeWidgetItem *treeItem = new QTreeWidgetItem(this); 83 treeItem->setText( 0, QString::number(e->getAtomicNumber()));84 treeItem->setText( 1, QString(e->getName().c_str()));85 treeItem->setText( 2, QString(e->getSymbol().c_str()));86 treeItem->setText( 3, QString::number(e->getMass()));87 treeItem->setText(NUMBER, QString::number(e->getAtomicNumber())); 88 treeItem->setText(NAME, QString(e->getName().c_str())); 89 treeItem->setText(SYMBOL, QString(e->getSymbol().c_str())); 90 treeItem->setText(MASS, QString::number(e->getMass())); 87 91 if (count > 0){ 88 treeItem->setText( 4, QString::number(count));92 treeItem->setText(OCCURRENCE, QString::number(count)); 89 93 }else{ 90 treeItem->setText( 4, "none");94 treeItem->setText(OCCURRENCE, "none"); 91 95 treeItem->setDisabled(true); 92 96 } 97 elementSelection.push_back(treeItem->isSelected()); 93 98 } 94 99 } … … 98 103 99 104 100 void QtElementList:: cellSelected(int row, int column)105 void QtElementList::rowSelected() 101 106 { 107 //std::cout << "rowSelected\n"; 108 periodentafel *&periode = World::getInstance().getPeriode(); 109 110 for (int i=0;i<topLevelItemCount();i++){ 111 QTreeWidgetItem *item = topLevelItem(i); 112 bool newSelection = item->isSelected(); 113 if (newSelection != elementSelection[i]){ 114 elementSelection[i] = newSelection; 115 116 int atomicNumber = item->text(NUMBER).toInt(); 117 const element *e = periode->FindElement(atomicNumber); 118 if (newSelection) 119 MoleCuilder::SelectionAtomByElement(e); 120 else 121 MoleCuilder::SelectionNotAtomByElement(e); 122 } 123 } 102 124 } 103 125 -
src/UIElements/Views/Qt4/QtElementList.hpp
rb14efe r1de61e 38 38 39 39 private slots: 40 void cellSelected(int row, int column); // itemSelectionChanged()40 void rowSelected(); 41 41 42 42 signals: … … 45 45 46 46 private: 47 std::vector<bool> molSelection; //!< needed to determine when a selection changes47 std::vector<bool> elementSelection; //!< needed to determine when a selection changes 48 48 MoleculeListClass *molecules; 49 49 bool dirty;
Note:
See TracChangeset
for help on using the changeset viewer.