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>
This commit is contained in:
parent
b74f180ac0
commit
3bac473364
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
|
Loading…
x
Reference in New Issue
Block a user