diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-08-25 16:39:11 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-08-25 14:00:24 -0700 |
commit | 4a6a9a67063002b917f406333ee66f3f74c3d29c (patch) | |
tree | e4df537057848a64bcdd0a5d67a2e91c637f418a /qt-ui/statistics/statisticswidget.cpp | |
parent | 3d5dde09adfce0631746eb8b8552dd47e6743c76 (diff) | |
download | subsurface-4a6a9a67063002b917f406333ee66f3f74c3d29c.tar.gz |
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 <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/statistics/statisticswidget.cpp')
-rw-r--r-- | qt-ui/statistics/statisticswidget.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
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 |