diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2025-11-18 10:34:07 +0100 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2025-11-27 11:55:59 +0100 |
| commit | 945e3faa20379cfd753ce3c6037806ba4319f98d (patch) | |
| tree | f16cd690c2aa6b5d8a2bc6dff43459df4fb33274 /src/qmlmodels/qqmltableinstancemodel.cpp | |
| parent | 9d60768a12376e67e90ab23ad64881bb85daeed7 (diff) | |
QmlModels: Rename QQmlDelegateModelItem::isReferenced()
Since there are two kinds of references, we need to be more specific.
Task-number: QTBUG-141963
Change-Id: I8583b91fab62abec49a5f71652e8c04fa8906b7b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmlmodels/qqmltableinstancemodel.cpp')
| -rw-r--r-- | src/qmlmodels/qqmltableinstancemodel.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/qmlmodels/qqmltableinstancemodel.cpp b/src/qmlmodels/qqmltableinstancemodel.cpp index e81251265f..5cd5d4be15 100644 --- a/src/qmlmodels/qqmltableinstancemodel.cpp +++ b/src/qmlmodels/qqmltableinstancemodel.cpp @@ -156,7 +156,7 @@ QObject *QQmlTableInstanceModel::object(int index, QQmlIncubator::IncubationMode // should be no object references either. And there should also not be any internal script // refs at this point. So we delete the model item. Q_ASSERT(!modelItem->isObjectReferenced()); - Q_ASSERT(!modelItem->isReferenced()); + Q_ASSERT(!modelItem->isScriptReferenced()); m_modelItems.remove(modelItem->modelIndex()); delete modelItem; return nullptr; @@ -174,7 +174,7 @@ QQmlInstanceModel::ReleaseFlags QQmlTableInstanceModel::release(QObject *object, if (!modelItem->releaseObject()) return QQmlDelegateModel::Referenced; - if (modelItem->isReferenced()) { + if (modelItem->isScriptReferenced()) { // We still have an internal reference to this object, which means that we are told to release an // object while the createdItem signal for it is still on the stack. This can happen when objects // are e.g delivered async, and the user flicks back and forth quicker than the loading can catch @@ -217,7 +217,7 @@ void QQmlTableInstanceModel::dispose(QObject *object) // The item is not referenced by anyone Q_ASSERT(!modelItem->isObjectReferenced()); - Q_ASSERT(!modelItem->isReferenced()); + Q_ASSERT(!modelItem->isScriptReferenced()); // Ensure that the object was incubated by this QQmlTableInstanceModel Q_ASSERT(m_modelItems.contains(modelItem->modelIndex())); Q_ASSERT(m_modelItems[modelItem->modelIndex()]->object() == object); @@ -362,7 +362,7 @@ void QQmlTableInstanceModel::incubatorStatusChanged(QQmlTableInstanceModelIncuba qWarning() << "Error incubating delegate:" << incubationTask->errors(); } - if (!modelItem->isReferenced() && !modelItem->isObjectReferenced()) { + if (!modelItem->isScriptReferenced() && !modelItem->isObjectReferenced()) { // We have no internal reference to the model item, and the view has no // reference to the incubated object. So just delete the model item. // Note that being here means that the object was incubated _async_ @@ -374,7 +374,7 @@ void QQmlTableInstanceModel::incubatorStatusChanged(QQmlTableInstanceModelIncuba emit destroyingItem(object); } - Q_ASSERT(!modelItem->isReferenced()); + Q_ASSERT(!modelItem->isScriptReferenced()); deleteModelItemLater(modelItem); } |
