From 84ec954073ff9e3230d222c1cdc0f3a5dd0c1476 Mon Sep 17 00:00:00 2001 From: Tannin Date: Thu, 3 Sep 2015 21:35:04 +0200 Subject: more intuitive sorting with grouping active --- src/modlistsortproxy.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/modlistsortproxy.cpp') diff --git a/src/modlistsortproxy.cpp b/src/modlistsortproxy.cpp index 0eeaa86f..4045d743 100644 --- a/src/modlistsortproxy.cpp +++ b/src/modlistsortproxy.cpp @@ -106,6 +106,10 @@ void ModListSortProxy::disableAllVisible() bool ModListSortProxy::lessThan(const QModelIndex &left, const QModelIndex &right) const { + if (sourceModel()->hasChildren(left) || sourceModel()->hasChildren(right)) { + return QSortFilterProxyModel::lessThan(left, right); + } + bool lOk, rOk; int leftIndex = left.data(Qt::UserRole + 1).toInt(&lOk); int rightIndex = right.data(Qt::UserRole + 1).toInt(&rOk); -- cgit v1.3.1