diff options
author | Ahmad Samir <a.samirh78@gmail.com> | 2023-09-22 00:44:13 +0300 |
---|---|---|
committer | Ahmad Samir <a.samirh78@gmail.com> | 2023-09-23 23:52:28 +0300 |
commit | 3bac47336483d720c1d7376ea053c03a4e80173c (patch) | |
tree | 25ba2d9abbcb253bd12ac1dccdb72d6aeec47e68 /src/corelib/itemmodels | |
parent | b74f180ac065741783dc4e7f793bb97e35aed7f7 (diff) |
QItemSelectionModel: remove some redundant code
QObject::disconnect(connection) already sets connection.d_ptr to
nullptr, and the default constructor only does that:
QMetaObject::Connection::Connection() : d_ptr(nullptr) {}
So calling disconnect() suffices in this case.
Pick-to: 6.6 6.5 6.2
Change-Id: Icd5f9a15c83939eeecd9efb474ac3b38c0f2dfe4
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Diffstat (limited to 'src/corelib/itemmodels')
-rw-r--r-- | src/corelib/itemmodels/qitemselectionmodel.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/corelib/itemmodels/qitemselectionmodel.cpp b/src/corelib/itemmodels/qitemselectionmodel.cpp index 67868b19e1..a558a0aa2f 100644 --- a/src/corelib/itemmodels/qitemselectionmodel.cpp +++ b/src/corelib/itemmodels/qitemselectionmodel.cpp @@ -595,10 +595,8 @@ void QItemSelectionModelPrivate::initModel(QAbstractItemModel *m) void QItemSelectionModelPrivate::disconnectModel() { - for (auto &connection : connections) { + for (auto &connection : connections) QObject::disconnect(connection); - connection = QMetaObject::Connection(); - } } /*! |