From 3d5dde09adfce0631746eb8b8552dd47e6743c76 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Mon, 25 Aug 2014 16:32:24 -0300 Subject: [PATCH] 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 Signed-off-by: Dirk Hohndel --- qt-ui/statistics/statisticswidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qt-ui/statistics/statisticswidget.cpp b/qt-ui/statistics/statisticswidget.cpp index 89555eb23..471814300 100644 --- a/qt-ui/statistics/statisticswidget.cpp +++ b/qt-ui/statistics/statisticswidget.cpp @@ -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)));