diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/modlistview.cpp | 13 | ||||
| -rw-r--r-- | src/modlistview.h | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/modlistview.cpp b/src/modlistview.cpp index c40b4752..243e78a4 100644 --- a/src/modlistview.cpp +++ b/src/modlistview.cpp @@ -906,6 +906,19 @@ void ModListView::drawBranches(QPainter* painter, const QRect& rect, const QMode QTreeView::drawBranches(painter, r, index);
}
+void ModListView::commitData(QWidget* editor)
+{
+ // maintain the selection when changing priority
+ if (currentIndex().column() == ModList::COL_PRIORITY) {
+ auto [current, selected] = this->selected();
+ QTreeView::commitData(editor);
+ setSelected(current, selected);
+ }
+ else {
+ QTreeView::commitData(editor);
+ }
+}
+
QModelIndexList ModListView::selectedIndexes() const
{
// during drag&drop events, we fake the return value of selectedIndexes()
diff --git a/src/modlistview.h b/src/modlistview.h index 122bf2f1..39099cf7 100644 --- a/src/modlistview.h +++ b/src/modlistview.h @@ -182,6 +182,8 @@ protected slots: void onFiltersCriteria(const std::vector<ModListSortProxy::Criteria>& filters);
void onProfileChanged(Profile* oldProfile, Profile* newProfile);
+ void commitData(QWidget* editor) override;
+
private:
friend class ModConflictIconDelegate;
|
