Changeset a8f5d94


Ignore:
Timestamp:
Oct 5, 2013, 9:32:58 AM (11 years ago)
Author:
Frederik Heber <heber@…>
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)
Message:

QtHomologyList is now a split with QTreeWidget and another widget.

Location:
src/UIElements/Views/Qt4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/Views/Qt4/QtHomologyList.cpp

    rd20ded ra8f5d94  
    3939
    4040#include <QAbstractItemView>
     41#include <QtGui/QTreeWidget>
     42#include<Qt/qsplitter.h>
    4143
    4244#include "CodePatterns/MemDebug.hpp"
     
    5153
    5254QtHomologyList::QtHomologyList(QWidget * _parent) :
    53     QTreeWidget (_parent),
     55    QWidget(_parent),
    5456    Observer("QtHomologyList")
    5557{
    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);
    5867
    5968  QStringList header;
    6069        for(int i=0; i<COLUMNCOUNT;++i)
    6170          header << COLUMNNAMES[i];
    62         setHeaderLabels(header);
     71        treewidget->setHeaderLabels(header);
    6372
    6473        dirty = true;
     
    7079        homologies.signOn(this);
    7180
    72   connect(this,SIGNAL(itemSelectionChanged()),this,SLOT(rowSelected()));
     81  connect(treewidget,SIGNAL(itemSelectionChanged()),this,SLOT(rowSelected()));
    7382  connect(this,SIGNAL(changed()),this,SLOT(update()));
    7483}
     
    8695  // force an update from Qt...
    8796  clearing = true;
    88   clear();
     97  treewidget->clear();
    8998  clearing = false;
    9099  //emit changed(); doesn't work!?!
     
    98107  // clear everything
    99108  HomologySelection.clear();
    100   clear();
     109  treewidget->clear();
    101110
    102111  size_t count = 0;
     
    107116    const size_t times = std::distance(occurences.first, occurences.second);
    108117
    109     QTreeWidgetItem *treeItem = new QTreeWidgetItem(this);
     118    QTreeWidgetItem *treeItem = new QTreeWidgetItem(treewidget);
    110119    treeItem->setText(NUMBER, QString::number(count));
    111120    {
     
    135144  if (dirty)
    136145    refill();
    137   QTreeWidget::paintEvent(event);
     146//  treewidget->paintEvent(event);
    138147}
    139148
     
    149158{
    150159  //std::cout << "rowSelected\n";
    151   for (int i=0;i<topLevelItemCount();i++){
    152     QTreeWidgetItem *item = topLevelItem(i);
     160  for (int i=0;i<treewidget->topLevelItemCount();i++){
     161    QTreeWidgetItem *item = treewidget->topLevelItem(i);
    153162    bool newSelection = item->isSelected();
    154163    if (newSelection != HomologySelection[i]){
  • src/UIElements/Views/Qt4/QtHomologyList.hpp

    rd20ded ra8f5d94  
    1515
    1616
    17 #include <QtGui/QTreeWidget>
     17#include <QtGui/QWidget>
    1818#include "CodePatterns/Observer/Observer.hpp"
    1919
    2020class HomologyGraph;
     21class QTreeWidget;
    2122
    22 class QtHomologyList: public QTreeWidget, public Observer
     23class QtHomologyList: public QWidget, public Observer
    2324{
    2425  Q_OBJECT
     
    5253  //!> flag to indicate that we currently clear the view, avoids thread collisions
    5354  bool clearing;
     55
     56private:
     57  QTreeWidget *treewidget;
     58  QWidget *widget;
    5459};
    5560
Note: See TracChangeset for help on using the changeset viewer.