diff --git a/UI/scene-tree.cpp b/UI/scene-tree.cpp index 469710962..1c2f1ab7e 100644 --- a/UI/scene-tree.cpp +++ b/UI/scene-tree.cpp @@ -236,3 +236,11 @@ void SceneTree::rowsInserted(const QModelIndex &parent, int start, int end) QListWidget::rowsInserted(parent, start, end); } + +// Workaround for QTBUG-105870. Remove once that is solved upstream. +void SceneTree::selectionChanged(const QItemSelection &selected, + const QItemSelection &deselected) +{ + if (selected.count() == 0) + setCurrentRow(deselected.indexes().front().row()); +} diff --git a/UI/scene-tree.hpp b/UI/scene-tree.hpp index 58cbb08fe..b80918f14 100644 --- a/UI/scene-tree.hpp +++ b/UI/scene-tree.hpp @@ -38,6 +38,9 @@ protected: virtual void dragLeaveEvent(QDragLeaveEvent *event) override; virtual void rowsInserted(const QModelIndex &parent, int start, int end) override; + virtual void + selectionChanged(const QItemSelection &selected, + const QItemSelection &deselected) override; signals: void scenesReordered();