- Timestamp:
- Oct 5, 2013, 9:32:58 AM (11 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:
- 291eca
- Parents:
- d20ded
- git-author:
- Frederik Heber <heber@…> (09/03/13 08:11:56)
- git-committer:
- Frederik Heber <heber@…> (10/05/13 09:32:58)
- Location:
- src/UIElements/Views/Qt4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Views/Qt4/QtHomologyList.cpp
rd20ded ra8f5d94 39 39 40 40 #include <QAbstractItemView> 41 #include <QtGui/QTreeWidget> 42 #include<Qt/qsplitter.h> 41 43 42 44 #include "CodePatterns/MemDebug.hpp" … … 51 53 52 54 QtHomologyList::QtHomologyList(QWidget * _parent) : 53 Q TreeWidget(_parent),55 QWidget(_parent), 54 56 Observer("QtHomologyList") 55 57 { 56 setColumnCount(COLUMNCOUNT); 57 setSelectionMode(QAbstractItemView::MultiSelection); 58 QSplitter *splitter = new QSplitter (Qt::Horizontal, this ); 59 treewidget = new QTreeWidget (splitter); 60 splitter->addWidget(treewidget); 61 widget = new QWidget (splitter); 62 splitter->addWidget(widget); 63 splitter->setStretchFactor(10, 1); 64 65 treewidget->setColumnCount(COLUMNCOUNT); 66 treewidget->setSelectionMode(QAbstractItemView::MultiSelection); 58 67 59 68 QStringList header; 60 69 for(int i=0; i<COLUMNCOUNT;++i) 61 70 header << COLUMNNAMES[i]; 62 setHeaderLabels(header);71 treewidget->setHeaderLabels(header); 63 72 64 73 dirty = true; … … 70 79 homologies.signOn(this); 71 80 72 connect(t his,SIGNAL(itemSelectionChanged()),this,SLOT(rowSelected()));81 connect(treewidget,SIGNAL(itemSelectionChanged()),this,SLOT(rowSelected())); 73 82 connect(this,SIGNAL(changed()),this,SLOT(update())); 74 83 } … … 86 95 // force an update from Qt... 87 96 clearing = true; 88 clear();97 treewidget->clear(); 89 98 clearing = false; 90 99 //emit changed(); doesn't work!?! … … 98 107 // clear everything 99 108 HomologySelection.clear(); 100 clear();109 treewidget->clear(); 101 110 102 111 size_t count = 0; … … 107 116 const size_t times = std::distance(occurences.first, occurences.second); 108 117 109 QTreeWidgetItem *treeItem = new QTreeWidgetItem(t his);118 QTreeWidgetItem *treeItem = new QTreeWidgetItem(treewidget); 110 119 treeItem->setText(NUMBER, QString::number(count)); 111 120 { … … 135 144 if (dirty) 136 145 refill(); 137 QTreeWidget::paintEvent(event);146 // treewidget->paintEvent(event); 138 147 } 139 148 … … 149 158 { 150 159 //std::cout << "rowSelected\n"; 151 for (int i=0;i<t opLevelItemCount();i++){152 QTreeWidgetItem *item = t opLevelItem(i);160 for (int i=0;i<treewidget->topLevelItemCount();i++){ 161 QTreeWidgetItem *item = treewidget->topLevelItem(i); 153 162 bool newSelection = item->isSelected(); 154 163 if (newSelection != HomologySelection[i]){ -
src/UIElements/Views/Qt4/QtHomologyList.hpp
rd20ded ra8f5d94 15 15 16 16 17 #include <QtGui/Q TreeWidget>17 #include <QtGui/QWidget> 18 18 #include "CodePatterns/Observer/Observer.hpp" 19 19 20 20 class HomologyGraph; 21 class QTreeWidget; 21 22 22 class QtHomologyList: public Q TreeWidget, public Observer23 class QtHomologyList: public QWidget, public Observer 23 24 { 24 25 Q_OBJECT … … 52 53 //!> flag to indicate that we currently clear the view, avoids thread collisions 53 54 bool clearing; 55 56 private: 57 QTreeWidget *treewidget; 58 QWidget *widget; 54 59 }; 55 60
Note:
See TracChangeset
for help on using the changeset viewer.