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.5 6.2 Change-Id: Icd5f9a15c83939eeecd9efb474ac3b38c0f2dfe4 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> (cherry picked from commit 3bac47336483d720c1d7376ea053c03a4e80173c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
8da777fa6a
commit
411a213f65
@ -595,10 +595,8 @@ void QItemSelectionModelPrivate::initModel(QAbstractItemModel *m)
|
|||||||
|
|
||||||
void QItemSelectionModelPrivate::disconnectModel()
|
void QItemSelectionModelPrivate::disconnectModel()
|
||||||
{
|
{
|
||||||
for (auto &connection : connections) {
|
for (auto &connection : connections)
|
||||||
QObject::disconnect(connection);
|
QObject::disconnect(connection);
|
||||||
connection = QMetaObject::Connection();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user