--- a/src/mainwindow.cpp Thu Feb 15 14:40:59 2018 +0200 +++ b/src/mainwindow.cpp Thu Feb 15 14:59:04 2018 +0200 @@ -1041,11 +1041,21 @@ */ } +QModelIndexList MainWindow::selectedIndexes() const +{ + return this->ui.objectList->selectionModel()->selectedIndexes(); +} + // --------------------------------------------------------------------------------------------------------------------- // -const QSet<LDObject*>& MainWindow::selectedObjects() +QSet<LDObject*> MainWindow::selectedObjects() const { - return m_currentDocument->getSelection(); + QSet<LDObject*> result; + + for (const QModelIndex& index : this->selectedIndexes()) + result.insert(m_currentDocument->lookup(index)); + + return result; } // ---------------------------------------------------------------------------------------------------------------------