1// Copyright (C) 2021 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#ifndef QQMLLISTACCESSOR_H
5#define QQMLLISTACCESSOR_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/QVariant>
19#include <QtCore/private/qglobal_p.h>
20
21QT_BEGIN_NAMESPACE
22
23class QQmlEngine;
24class Q_AUTOTEST_EXPORT QQmlListAccessor
25{
26public:
27 QQmlListAccessor();
28 ~QQmlListAccessor();
29
30 QVariant list() const;
31 void setList(const QVariant &);
32
33 bool isValid() const;
34
35 qsizetype count() const;
36 QVariant at(qsizetype) const;
37 void set(qsizetype, const QVariant &);
38
39 enum Type {
40 Invalid,
41 StringList,
42 UrlList,
43 VariantList,
44 ObjectList,
45 ListProperty,
46 Instance,
47 Integer,
48 Sequence,
49 };
50
51 Type type() const { return m_type; }
52
53private:
54 Type m_type;
55 QMetaSequence m_metaSequence;
56 QVariant d;
57};
58
59QT_END_NAMESPACE
60
61#endif // QQMLLISTACCESSOR_H
62

source code of qtdeclarative/src/qmlmodels/qqmllistaccessor_p.h