فهرست منبع

UI: Add workaround for scenes being unselected

gxalpha 3 سال پیش
والد
کامیت
08e4ee6557
2فایلهای تغییر یافته به همراه11 افزوده شده و 0 حذف شده
  1. 8 0
      UI/scene-tree.cpp
  2. 3 0
      UI/scene-tree.hpp

+ 8 - 0
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());
+}

+ 3 - 0
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();