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:
parent
b01ef9a0a5
commit
3d5dde09ad
@ -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)));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user