diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2024-01-29 11:20:20 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2024-01-30 17:14:09 +0100 |
commit | 6a278ea43e7d49d7339206a311a63dc2ee291b01 (patch) | |
tree | e50f4504b49186c7bd3e658bf2078c2e19b55fd7 /src/qmlmodels/qqmldmlistaccessordata_p.h | |
parent | 642d531e42fb233709155f8c8feb7d429c48db38 (diff) |
QmlModels: Explicitly clear list data dynamic metaobject
Otherwise it can try to access model objects after they are deleted.
Pick-to: 6.7
Fixes: QTBUG-121588
Change-Id: I4420611be19dc650b7bf29ae805a7477e4c3d7c0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Nicolas Fella <nicolas.fella@kdab.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/qmlmodels/qqmldmlistaccessordata_p.h')
-rw-r--r-- | src/qmlmodels/qqmldmlistaccessordata_p.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/qmlmodels/qqmldmlistaccessordata_p.h b/src/qmlmodels/qqmldmlistaccessordata_p.h index 1bdd6d3acd..12ec484a9c 100644 --- a/src/qmlmodels/qqmldmlistaccessordata_p.h +++ b/src/qmlmodels/qqmldmlistaccessordata_p.h @@ -29,8 +29,11 @@ class QQmlDMListAccessorData : public QQmlDelegateModelItem Q_PROPERTY(QVariant modelData READ modelData WRITE setModelData NOTIFY modelDataChanged FINAL) QT_ANONYMOUS_PROPERTY(QVariant READ modelData WRITE setModelData NOTIFY modelDataChanged) public: - QQmlDMListAccessorData(const QQmlRefPointer<QQmlDelegateModelItemMetaType> &metaType, - VDMListDelegateDataType *dataType, int index, int row, int column, const QVariant &value); + QQmlDMListAccessorData( + const QQmlRefPointer<QQmlDelegateModelItemMetaType> &metaType, + VDMListDelegateDataType *dataType, int index, int row, int column, + const QVariant &value); + ~QQmlDMListAccessorData(); QVariant modelData() const { @@ -273,11 +276,6 @@ public: return true; } - void objectDestroyed(QObject *) override - { - release(); - } - void emitAllSignals(QQmlDMListAccessorData *accessor) const; int metaCall(QObject *object, QMetaObject::Call call, int id, void **arguments) final; |