From 7ab7f97881d8f826c123050511063a4627901f92 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Tue, 6 Feb 2018 17:59:48 +0100 Subject: 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 --- src/widgets/itemviews/qtreewidget.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/widgets/itemviews/qtreewidget.cpp') 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&,const QPair&); - 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 *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; -- cgit v1.2.3