diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2017-12-27 22:27:13 +0100 |
---|---|---|
committer | Jan Mulder <jlmulder@xs4all.nl> | 2017-12-28 09:11:12 +0100 |
commit | c3b1c641837a441734ee9c525f5ed3699735c18c (patch) | |
tree | 6cbd011698e06babda488ef35087a1f0302b0af5 /qt-models | |
parent | 6cc5b601aa36a7ede89ab13274cb334aa92f5cf7 (diff) | |
download | subsurface-c3b1c641837a441734ee9c525f5ed3699735c18c.tar.gz |
Remove unnecessary dynamic_cast<>s in filter code
FilterModelBase is a direct subclass of QAbstractItemModel. Therefore,
dynamic_cast<>ing the former to the latter is unnecessary. Probably
an artifact of previous code.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models')
-rw-r--r-- | qt-models/filtermodels.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/qt-models/filtermodels.cpp b/qt-models/filtermodels.cpp index 48a2fd9b9..cb83ce946 100644 --- a/qt-models/filtermodels.cpp +++ b/qt-models/filtermodels.cpp @@ -479,18 +479,14 @@ void MultiFilterSortModel::myInvalidate() void MultiFilterSortModel::addFilterModel(FilterModelBase *model) { - QAbstractItemModel *itemModel = dynamic_cast<QAbstractItemModel *>(model); - Q_ASSERT(itemModel); models.append(model); - connect(itemModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(myInvalidate())); + connect(model, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(myInvalidate())); } void MultiFilterSortModel::removeFilterModel(FilterModelBase *model) { - QAbstractItemModel *itemModel = dynamic_cast<QAbstractItemModel *>(model); - Q_ASSERT(itemModel); models.removeAll(model); - disconnect(itemModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(myInvalidate())); + disconnect(model, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(myInvalidate())); } void MultiFilterSortModel::clearFilter() |