diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2018-02-06 17:59:48 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2018-02-10 13:19:03 +0000 |
commit | 7ab7f97881d8f826c123050511063a4627901f92 (patch) | |
tree | 54169463e77ec02168e209aa0f2d8639eb95724a /src/widgets/itemviews/qtreewidget.cpp | |
parent | 85f6dd83251cd0cf940c5d9a9a1df731e9c4923c (diff) |
QList/Table/TreeWidget: remove vc6 workaround
There was a typedef used for comparisons of the items which was for
VC6 according to the comment. Replaced the typedef with auto and did
a testcompile with MSVC2015 - worked fine.
Change-Id: Ibdbc2332d49d2dd533ab35180f49c9dcd143c627
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/widgets/itemviews/qtreewidget.cpp')
-rw-r--r-- | src/widgets/itemviews/qtreewidget.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/widgets/itemviews/qtreewidget.cpp b/src/widgets/itemviews/qtreewidget.cpp index 93094594e9..07907711d7 100644 --- a/src/widgets/itemviews/qtreewidget.cpp +++ b/src/widgets/itemviews/qtreewidget.cpp @@ -52,9 +52,6 @@ QT_BEGIN_NAMESPACE -// workaround for VC++ 6.0 linker bug (?) -typedef bool(*LessThan)(const QPair<QTreeWidgetItem*,int>&,const QPair<QTreeWidgetItem*,int>&); - class QTreeModelLessThan { public: @@ -610,7 +607,7 @@ void QTreeModel::ensureSorted(int column, Qt::SortOrder order, sorting[i].second = start + i; } - LessThan compare = (order == Qt::AscendingOrder ? &itemLessThan : &itemGreaterThan); + const auto compare = (order == Qt::AscendingOrder ? &itemLessThan : &itemGreaterThan); std::stable_sort(sorting.begin(), sorting.end(), compare); QModelIndexList oldPersistentIndexes; @@ -850,7 +847,7 @@ void QTreeModel::sortItems(QList<QTreeWidgetItem*> *items, int column, Qt::SortO } // do the sorting - LessThan compare = (order == Qt::AscendingOrder ? &itemLessThan : &itemGreaterThan); + const auto compare = (order == Qt::AscendingOrder ? &itemLessThan : &itemGreaterThan); std::stable_sort(sorting.begin(), sorting.end(), compare); QModelIndexList fromList; |