Use aboutToBeRemoved instead of removed

If we used removed things from the interface we could hit a dangling
pointer, so first delete the items, then let the system delete the rows.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-08-25 16:32:24 -03:00 committed by Dirk Hohndel
parent b01ef9a0a5
commit 3d5dde09ad

View file

@ -11,7 +11,7 @@ void YearlyStatisticsWidget::setModel(YearlyStatisticsModel *m)
m_model = m;
connect(m, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
this, SLOT(modelDataChanged(QModelIndex,QModelIndex)));
connect(m, SIGNAL(rowsRemoved(QModelIndex,int,int)),
connect(m, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
this, SLOT(modelRowsRemoved(QModelIndex,int,int)));
connect(m, SIGNAL(rowsInserted(QModelIndex,int,int)),
this, SLOT(modelRowsInserted(QModelIndex,int,int)));