diff --git a/Polyhedron/demo/Polyhedron/MainWindow.cpp b/Polyhedron/demo/Polyhedron/MainWindow.cpp index c6fc884652b..717ef7e4b80 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -151,6 +151,9 @@ MainWindow::MainWindow(QWidget* parent) connect(scene, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex & )), this, SLOT(updateInfo())); +connect(scene, SIGNAL(itemsDestroyed()), + this, SLOT(updateInfo())); + connect(scene, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex & )), this, SLOT(updateDisplayInfo())); diff --git a/Polyhedron/demo/Polyhedron/Scene.cpp b/Polyhedron/demo/Polyhedron/Scene.cpp index 8169c09e2c7..54346a8b568 100644 --- a/Polyhedron/demo/Polyhedron/Scene.cpp +++ b/Polyhedron/demo/Polyhedron/Scene.cpp @@ -111,6 +111,8 @@ Scene::erase(QList indices) emit updated(); QAbstractListModel::reset(); + emit itemsDestroyed(); + int index = max_index + 1 - indices.size(); if(index >= 0) return index; diff --git a/Polyhedron/demo/Polyhedron/Scene.h b/Polyhedron/demo/Polyhedron/Scene.h index a020143068f..0a19fd9ee12 100644 --- a/Polyhedron/demo/Polyhedron/Scene.h +++ b/Polyhedron/demo/Polyhedron/Scene.h @@ -130,6 +130,7 @@ signals: void updated_bbox(); void updated(); void itemAboutToBeDestroyed(Scene_item*); + void itemsDestroyed(); void selectionRay(double, double, double, double, double, double); private slots: