UI: Check item whether selected before select

To prevent item from being selected again,
then mess up the qt internal list order.
This commit is contained in:
bin 2022-11-04 00:43:46 +08:00 • committed by Patrick Heyer
commit 559925ebaa

View file

@ -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);