update info when items are deleted

This commit is contained in:
Sébastien Loriot 2012-08-01 06:16:15 +00:00
parent eecde00a77
commit ea408a8602
3 changed files with 6 additions and 0 deletions

View File

@ -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()));

View File

@ -111,6 +111,8 @@ Scene::erase(QList<int> indices)
emit updated();
QAbstractListModel::reset();
emit itemsDestroyed();
int index = max_index + 1 - indices.size();
if(index >= 0)
return index;

View File

@ -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: