From 559925ebaa4262fe383234097da47967646c9d4f Mon Sep 17 00:00:00 2001 From: bin Date: Fri, 4 Nov 2022 00:43:46 +0800 Subject: [PATCH] UI: Check item whether selected before select To prevent item from being selected again, then mess up the qt internal list order. --- UI/source-tree.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UI/source-tree.cpp b/UI/source-tree.cpp index 43d894838..91e83bb9a 100644 --- a/UI/source-tree.cpp +++ b/UI/source-tree.cpp @@ -1154,7 +1154,7 @@ void SourceTree::SelectItem(obs_sceneitem_t *sceneitem, bool select) return; QModelIndex index = stm->createIndex(i, 0); - if (index.isValid()) + if (index.isValid() && select != selectionModel()->isSelected(index)) selectionModel()->select( index, select ? QItemSelectionModel::Select : QItemSelectionModel::Deselect);