Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qqmladaptormodelenginedata.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
4#include <private/qqmladaptormodelenginedata_p.h>
5#include <private/qqmldmlistaccessordata_p.h>
6
8
10 : v4(v4)
11{
12 QV4::Scope scope(v4);
13 QV4::ScopedObject proto(scope, v4->newObject());
14 proto->defineAccessorProperty(QStringLiteral("index"), get_index, nullptr);
15 proto->defineAccessorProperty(
16 QStringLiteral("modelData"),
18 proto->defineAccessorProperty(
19 QString(),
21 listItemProto.set(v4, proto);
22}
23
QQmlAdaptorModelEngineData(QV4::ExecutionEngine *v4)
static QV4::ReturnedValue get_index(const QV4::FunctionObject *f, const QV4::Value *thisObject, const QV4::Value *, int)
static QV4::ReturnedValue get_modelData(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int)
static QV4::ReturnedValue set_modelData(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
void set(ExecutionEngine *engine, const Value &value)
Combined button and popup list for selecting options.
#define QStringLiteral(str)
Heap::Object * newObject()