summaryrefslogtreecommitdiff
path: root/src/modlistsortproxy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modlistsortproxy.cpp')
-rw-r--r--src/modlistsortproxy.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/modlistsortproxy.cpp b/src/modlistsortproxy.cpp
index fc7f3270..4084af24 100644
--- a/src/modlistsortproxy.cpp
+++ b/src/modlistsortproxy.cpp
@@ -108,6 +108,12 @@ bool ModListSortProxy::lessThan(const QModelIndex &left,
if (sortColumn() != ModList::COL_PRIORITY) {
return QSortFilterProxyModel::lessThan(left, right);
}
+ else if (qobject_cast<QtGroupingProxy*>(sourceModel())) {
+ // if the underlying proxy is a QtGroupingProxy we need to rely on
+ // Qt::DisplayRole because the other roles are not correctly handled
+ // by that kind of proxy
+ return left.data(Qt::DisplayRole).toInt() < right.data(Qt::DisplayRole).toInt();
+ }
}
bool lOk, rOk;