Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqmldmobjectdata.cpp
Go to the documentation of this file.
1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant
4
5#include <private/qqmldmobjectdata_p.h>
6
7QT_BEGIN_NAMESPACE
8
9QQmlDMObjectData::QQmlDMObjectData(const QQmlRefPointer<QQmlDelegateModelItemMetaType> &metaType,
10 VDMObjectDelegateDataType *dataType,
11 int index, int row, int column,
12 QObject *object)
13 : QQmlDelegateModelItem(metaType, dataType, index, row, column)
14 , object(object)
15{
16 new QQmlDMObjectDataMetaObject(this, dataType);
17}
18
19QQmlRefPointer<QQmlContextData> QQmlDMObjectData::initProxy()
20{
21 QQmlRefPointer<QQmlContextData> ctxt = QQmlContextData::createChild(contextData);
22 incubationTask->proxiedObject = object;
23 incubationTask->proxyContext = ctxt;
24 ctxt->setContextObject(this);
25 // We don't own the proxied object. We need to clear it if it goes away.
26 QObject::connect(object, &QObject::destroyed,
27 this, &QQmlDelegateModelItem::childContextObjectDestroyed);
28 return ctxt;
29}
30
31QT_END_NAMESPACE