diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-02-23 19:16:18 +0100 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-02-23 19:16:18 +0100 |
| commit | 27c4861907d57c3e2b79bc476972325a6d6efa49 (patch) | |
| tree | 801bd92adb6d7ba68536d35bfa3f52bcf0368ece /src/modlistsortproxy.cpp | |
| parent | 8decb9df6831a2b953b122cd509361eb1539e84e (diff) | |
Fix sorting by priority when grouping by priority.
Diffstat (limited to 'src/modlistsortproxy.cpp')
| -rw-r--r-- | src/modlistsortproxy.cpp | 6 |
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;
|
