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 & )), connect(scene, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex & )),
this, SLOT(updateInfo())); this, SLOT(updateInfo()));
connect(scene, SIGNAL(itemsDestroyed()),
this, SLOT(updateInfo()));
connect(scene, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex & )), connect(scene, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex & )),
this, SLOT(updateDisplayInfo())); this, SLOT(updateDisplayInfo()));

View File

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

View File

@ -130,6 +130,7 @@ signals:
void updated_bbox(); void updated_bbox();
void updated(); void updated();
void itemAboutToBeDestroyed(Scene_item*); void itemAboutToBeDestroyed(Scene_item*);
void itemsDestroyed();
void selectionRay(double, double, double, double, double, double); void selectionRay(double, double, double, double, double, double);
private slots: private slots: