From 4a6a9a67063002b917f406333ee66f3f74c3d29c Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Mon, 25 Aug 2014 16:39:11 -0300 Subject: Use scene()->clear() instead of manually clearing the scene. When there's a rowsAboutToBeRemoevd, remove all items from the scene() by calling scene()->clear(), instead of creating a method just for that. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/statistics/statisticswidget.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'qt-ui/statistics/statisticswidget.cpp') diff --git a/qt-ui/statistics/statisticswidget.cpp b/qt-ui/statistics/statisticswidget.cpp index 471814300..6dafba606 100644 --- a/qt-ui/statistics/statisticswidget.cpp +++ b/qt-ui/statistics/statisticswidget.cpp @@ -12,11 +12,10 @@ void YearlyStatisticsWidget::setModel(YearlyStatisticsModel *m) connect(m, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(modelDataChanged(QModelIndex,QModelIndex))); connect(m, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), - this, SLOT(modelRowsRemoved(QModelIndex,int,int))); + scene(), SLOT(clear())); connect(m, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(modelRowsInserted(QModelIndex,int,int))); - modelRowsRemoved(QModelIndex(),0,m_model->rowCount()-1); modelRowsInserted(QModelIndex(),0,m_model->rowCount()-1); } @@ -25,11 +24,6 @@ void YearlyStatisticsWidget::modelRowsInserted(const QModelIndex &index, int fir // stub } -void YearlyStatisticsWidget::modelRowsRemoved(const QModelIndex &index, int first, int last) -{ - // stub -} - void YearlyStatisticsWidget::modelDataChanged(const QModelIndex &topLeft, const QModelIndex& bottomRight) { // stub -- cgit v1.2.3-70-g09d2