fix(editor): getSelection not properly representing selection

This commit is contained in:
maelstrom 2025-04-12 15:07:33 +02:00
parent d8d469d0e8
commit 07272dbe95

View file

@ -31,13 +31,11 @@ ExplorerView::ExplorerView(QWidget* parent):
connect(selectionModel(), &QItemSelectionModel::selectionChanged, this, [&](const QItemSelection &selected, const QItemSelection &deselected) {
std::vector<InstanceRefWeak> 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()) {
for (auto index : selectedIndexes()) {
selectedInstances.push_back(reinterpret_cast<Instance*>(index.internalPointer())->weak_from_this());
}
}
::setSelection(selectedInstances, true);
});