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
4#include <private/qqmladaptormodelenginedata_p.h>
5#include <private/qqmldmlistaccessordata_p.h>
6
7QT_BEGIN_NAMESPACE
8
9QQmlAdaptorModelEngineData::QQmlAdaptorModelEngineData(QV4::ExecutionEngine *v4)
10 : v4(v4)
11{
12 QV4::Scope scope(v4);
13 QV4::ScopedObject proto(scope, v4->newObject());
14 proto->defineAccessorProperty(QStringLiteral("index"), getter: get_index, setter: nullptr);
15 proto->defineAccessorProperty(
16 QStringLiteral("modelData"),
17 getter: QQmlDMListAccessorData::get_modelData, setter: QQmlDMListAccessorData::set_modelData);
18 proto->defineAccessorProperty(
19 name: QString(),
20 getter: QQmlDMListAccessorData::get_modelData, setter: QQmlDMListAccessorData::set_modelData);
21 listItemProto.set(engine: v4, value: proto);
22}
23
24QT_END_NAMESPACE
25

source code of qtdeclarative/src/qmlmodels/qqmladaptormodelenginedata.cpp