diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-01-19 18:08:05 +0100 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-01-19 18:08:05 +0100 |
| commit | 932a562d9d36d10ec29821ee0af957f0dd3da498 (patch) | |
| tree | b428e3c8e839ca6a098be3a706d3a8f65ac3f7ea /src | |
| parent | 838415aa719416eaa778d3cb09669be58941a26e (diff) | |
Fix refresh on by-priority proxy when changing sort order.
Diffstat (limited to 'src')
| -rw-r--r-- | src/modlistbypriorityproxy.cpp | 5 | ||||
| -rw-r--r-- | src/modlistbypriorityproxy.h | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/modlistbypriorityproxy.cpp b/src/modlistbypriorityproxy.cpp index ac50e823..7dae7a54 100644 --- a/src/modlistbypriorityproxy.cpp +++ b/src/modlistbypriorityproxy.cpp @@ -41,7 +41,10 @@ void ModListByPriorityProxy::setProfile(Profile* profile) void ModListByPriorityProxy::setSortOrder(Qt::SortOrder order) { - m_sortOrder = order; + if (m_sortOrder != order) { + m_sortOrder = order; + onModelLayoutChanged(); + } } void ModListByPriorityProxy::buildMapping() diff --git a/src/modlistbypriorityproxy.h b/src/modlistbypriorityproxy.h index 77e0fe3d..0629bef7 100644 --- a/src/modlistbypriorityproxy.h +++ b/src/modlistbypriorityproxy.h @@ -54,7 +54,7 @@ public slots: protected slots: void onModelRowsRemoved(const QModelIndex& parent, int first, int last); - void onModelLayoutChanged(const QList<QPersistentModelIndex>& parents, LayoutChangeHint hint); + void onModelLayoutChanged(const QList<QPersistentModelIndex>& parents = {}, LayoutChangeHint hint = LayoutChangeHint::NoLayoutChangeHint); void onModelReset(); void onModelDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight, const QVector<int>& roles = QVector<int>()); |
