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 | |
21 | QT_BEGIN_NAMESPACE |
22 | |
23 | class QQmlEngine; |
24 | class Q_AUTOTEST_EXPORT QQmlListAccessor |
25 | { |
26 | public: |
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 | |
53 | private: |
54 | Type m_type; |
55 | QMetaSequence m_metaSequence; |
56 | QVariant d; |
57 | }; |
58 | |
59 | QT_END_NAMESPACE |
60 | |
61 | #endif // QQMLLISTACCESSOR_H |
62 | |