Changeset 4aed01


Ignore:
Timestamp:
Sep 9, 2016, 10:09:47 AM (8 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_StructOpt_integration_tests, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, 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_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, GeometryObjects, Gui_displays_atomic_force_velocity, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, Ubuntu_1604_changes, stable
Children:
d88397
Parents:
562b0a
git-author:
Frederik Heber <heber@…> (09/01/16 14:14:18)
git-committer:
Frederik Heber <heber@…> (09/09/16 10:09:47)
Message:

FragmentList's and QtHomologyList's numerical columns are now properly sorted.

  • we need to reimplement operator<() by subclassing the QTreeWidgetItem.
  • we define which columns are numerical and apply proper sorting by recast the contained text().
Location:
src/UIElements
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/Makefile.am

    r562b0a r4aed01  
    193193  UIElements/Views/Qt4/QtInfoBox.cpp \
    194194  UIElements/Views/Qt4/QtLogBox.cpp \
     195  UIElements/Views/Qt4/QtNumericalItem.cpp \
    195196  UIElements/Views/Qt4/QtShapeController.cpp \
    196197  UIElements/Views/Qt4/QtShapeList.cpp \
     
    227228  UIElements/Views/Qt4/QtInfoBox.hpp \
    228229  UIElements/Views/Qt4/QtLogBox.hpp \
     230  UIElements/Views/Qt4/QtNumericalItem.hpp \
    229231  UIElements/Views/Qt4/QtShapeController.hpp \
    230232  UIElements/Views/Qt4/QtShapeList.hpp \
  • src/UIElements/Views/Qt4/QtFragmentList.cpp

    r562b0a r4aed01  
    3434
    3535#include "Views/Qt4/QtFragmentList.hpp"
     36#include "Views/Qt4/QtNumericalItem.hpp"
     37
     38#include <QAbstractItemView>
     39
     40#include "CodePatterns/MemDebug.hpp"
    3641
    3742#include <iterator>
    3843#include <iostream>
    3944
    40 #include <QAbstractItemView>
    41 
    42 #include "CodePatterns/MemDebug.hpp"
     45#include <boost/assign.hpp>
    4346
    4447#include "CodePatterns/Log.hpp"
     
    5457using namespace std;
    5558
     59using namespace boost::assign;
     60
    5661const int QtFragmentList::COLUMNCOUNT = COLUMNTYPES_MAX;
    5762const char *QtFragmentList::COLUMNNAMES[QtFragmentList::COLUMNCOUNT]={"Number","KeySet","Formula","Energy value","Energy contribution"};
     
    6772          header << COLUMNNAMES[i];
    6873        setHeaderLabels(header);
    69         sortByColumn(0);
     74        sortByColumn(0, Qt::AscendingOrder);
    7075
    7176        setSelectionMode( MultiSelection );
     
    122127      ++keyiter,++resultiter,++count) {
    123128
    124     QTreeWidgetItem *treeItem = new QTreeWidgetItem(this);
     129    std::vector<int> numerical_columns;
     130    numerical_columns += ENERGYVALUE, ENERGYCONTRIBUTION;
     131    QTreeWidgetItem *treeItem = new QtNumericalItem(NUMBER, numerical_columns, this);
    125132    treeItem->setText(NUMBER, QString::number(count));
    126133    {
  • src/UIElements/Views/Qt4/QtHomologyList.cpp

    r562b0a r4aed01  
    3434
    3535#include "Views/Qt4/QtHomologyList.hpp"
    36 
    37 #include <iterator>
    38 #include <iostream>
     36#include "Views/Qt4/QtNumericalItem.hpp"
    3937
    4038#include <QAbstractItemView>
     
    4644
    4745#include "CodePatterns/MemDebug.hpp"
     46
     47#include <iterator>
     48#include <iostream>
     49
     50#include <boost/assign.hpp>
    4851
    4952#include "CodePatterns/Log.hpp"
     
    6669
    6770using namespace std;
     71
     72using namespace boost::assign;
    6873
    6974const int QtHomologyList::COLUMNCOUNT = COLUMNTYPES_MAX;
     
    178183
    179184    // create item
    180     QTreeWidgetItem *treeItem = new QTreeWidgetItem(treewidget);
     185    std::vector<int> numerical_columns;
     186    numerical_columns += OCCURRENCE;
     187    QTreeWidgetItem *treeItem = new QtNumericalItem(NUMBER, numerical_columns, treewidget);
    181188    treeItem->setText(NUMBER, QString::number(count));
    182189    {
Note: See TracChangeset for help on using the changeset viewer.