From 07272dbe95a9dfb194a097d5bd36eb994599a41c Mon Sep 17 00:00:00 2001 From: maelstrom Date: Sat, 12 Apr 2025 15:07:33 +0200 Subject: [PATCH] fix(editor): getSelection not properly representing selection --- editor/panes/explorerview.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/editor/panes/explorerview.cpp b/editor/panes/explorerview.cpp index 4de6692..80f4b7c 100644 --- a/editor/panes/explorerview.cpp +++ b/editor/panes/explorerview.cpp @@ -31,12 +31,10 @@ ExplorerView::ExplorerView(QWidget* parent): connect(selectionModel(), &QItemSelectionModel::selectionChanged, this, [&](const QItemSelection &selected, const QItemSelection &deselected) { std::vector selectedInstances; - selectedInstances.reserve(selected.count()); // This doesn't reserve everything, but should enhance things anyway + selectedInstances.reserve(selectedIndexes().count()); // This doesn't reserve everything, but should enhance things anyway - for (auto range : selected) { - for (auto index : range.indexes()) { - selectedInstances.push_back(reinterpret_cast(index.internalPointer())->weak_from_this()); - } + for (auto index : selectedIndexes()) { + selectedInstances.push_back(reinterpret_cast(index.internalPointer())->weak_from_this()); } ::setSelection(selectedInstances, true);