Changeset 2eeb21


Ignore:
Timestamp:
Sep 2, 2016, 7:56:52 AM (8 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Gui_Fixes
Children:
f62b00
Parents:
e03e9f
Message:

tempcommit: QtNumericalItem::operator<() seems to be called always??

  • also, occurence should be sorted numerically, too.
Location:
src/UIElements/Views/Qt4
Files:
4 edited

Legend:

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

    re03e9f r2eeb21  
    116116      ++keyiter,++resultiter,++count) {
    117117
    118     QTreeWidgetItem *treeItem = new QtNumericalItem(this);
     118    QTreeWidgetItem *treeItem = new QtNumericalItem(NUMBER, this);
    119119    treeItem->setText(NUMBER, QString::number(count));
    120120    {
  • src/UIElements/Views/Qt4/QtHomologyList.cpp

    re03e9f r2eeb21  
    179179
    180180    // create item
    181     QTreeWidgetItem *treeItem = new QtNumericalItem(this);
     181    QTreeWidgetItem *treeItem = new QtNumericalItem(NUMBER, treewidget);
    182182    treeItem->setText(NUMBER, QString::number(count));
    183183    {
  • src/UIElements/Views/Qt4/QtNumericalItem.cpp

    re03e9f r2eeb21  
    4444bool QtNumericalItem::operator<(const QTreeWidgetItem &_item) const {
    4545  const int col = treeWidget()->sortColumn();
    46   const int mynr = boost::lexical_cast<int>(QTreeWidgetItem::text(col).toStdString());
    47   const int othernr = boost::lexical_cast<int>(_item.text(col).toStdString());
    48   return mynr < othernr;
     46  if (col == view_column) {
     47    const int mynr = boost::lexical_cast<int>(QTreeWidgetItem::text(col).toStdString());
     48    const int othernr = boost::lexical_cast<int>(_item.text(col).toStdString());
     49    return mynr < othernr;
     50  } else
     51    return QTreeWidgetItem::text(col).toStdString() < _item.text(col).toStdString();
    4952}
    5053
  • src/UIElements/Views/Qt4/QtNumericalItem.hpp

    re03e9f r2eeb21  
    2222{
    2323public:
    24   QtNumericalItem(QTreeWidget *parent = 0) :
    25     QTreeWidgetItem(parent)
     24  QtNumericalItem(int column, QTreeWidget *parent = 0) :
     25    QTreeWidgetItem(parent),
     26    view_column(column)
    2627  {}
    2728
    2829  bool operator<(const QTreeWidgetItem &_item) const;
     30
     31private:
     32  //!> such that we know that we need to check
     33  const int view_column;
    2934};
    3035
Note: See TracChangeset for help on using the changeset viewer.