src/mainwindow.cpp

changeset 1250
e2755ccf3667
parent 1249
6a8f76f0f4d1
child 1251
e75cc5bff076
--- 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;
 }
 
 // ---------------------------------------------------------------------------------------------------------------------

mercurial