diff --git a/Polyhedron/demo/Polyhedron/MainWindow.cpp b/Polyhedron/demo/Polyhedron/MainWindow.cpp index 4c16dff610e..e910273388d 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -1337,6 +1337,8 @@ void MainWindow::selectSceneItem(int i) else { QItemSelection s = proxyModel->mapSelectionFromSource(scene->createSelection(i)); + if(s.empty()) + return; QModelIndex mi = proxyModel->mapFromSource(scene->getModelIndexFromId(i).first()); sceneView->setCurrentIndex(mi); sceneView->selectionModel()->select(s, @@ -1407,10 +1409,7 @@ void MainWindow::removeSceneItemFromSelection(int i) void MainWindow::selectAll() { - QItemSelection s = - proxyModel->mapSelectionFromSource(scene->createSelectionAll()); - sceneView->selectionModel()->select(s, - QItemSelectionModel::ClearAndSelect); + sceneView->selectAll(); } int MainWindow::getSelectedSceneItemIndex() const