Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qqmlopenmetaobject_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 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 QQMLOPENMETAOBJECT_H
5#define QQMLOPENMETAOBJECT_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/QMetaObject>
19#include <QtCore/QObject>
20
21#include <private/qqmlrefcount_p.h>
22#include <private/qtqmlglobal_p.h>
23#include <private/qobject_p.h>
24
26
27
28class QQmlEngine;
31class Q_QML_EXPORT QQmlOpenMetaObjectType final
32 : public QQmlRefCounted<QQmlOpenMetaObjectType>
33{
34public:
37
38 void createProperties(const QVector<QByteArray> &names);
39 int createProperty(const QByteArray &name);
40
41 int propertyOffset() const;
42 int signalOffset() const;
43
44 int propertyCount() const;
45 QByteArray propertyName(int) const;
46
47protected:
48 virtual void propertyCreated(int, QMetaPropertyBuilder &);
49
50private:
52 friend class QQmlOpenMetaObject;
54};
55
58{
59public:
60 QQmlOpenMetaObject(QObject *, const QMetaObject * = nullptr);
61 QQmlOpenMetaObject(QObject *, const QQmlRefPointer<QQmlOpenMetaObjectType> &);
62 ~QQmlOpenMetaObject() override;
63
64 QVariant value(const QByteArray &) const;
65 bool setValue(const QByteArray &, const QVariant &, bool force = false);
66 void setValues(const QHash<QByteArray, QVariant> &, bool force = false);
67 QVariant value(int) const;
68 void setValue(int, const QVariant &);
69 QVariant &valueRef(const QByteArray &);
70 bool hasValue(int) const;
71
72 int count() const;
73 QByteArray name(int) const;
74
75 QObject *object() const;
76 virtual QVariant initialValue(int);
77
78 // Be careful - once setCached(true) is called createProperty() is no
79 // longer automatically called for new properties.
80 void setCached(bool);
81
82 bool autoCreatesProperties() const;
83 void setAutoCreatesProperties(bool autoCreate);
84
86
87 void emitPropertyNotification(const QByteArray &propertyName);
88 void unparent();
89
90protected:
91 int metaCall(QObject *o, QMetaObject::Call _c, int _id, void **_a) override;
92 int createProperty(const char *, const char *) override;
93
94 virtual void propertyRead(int);
95 virtual void propertyWrite(int);
96 virtual QVariant propertyWriteValue(int, const QVariant &);
97 virtual void propertyWritten(int);
98 virtual void propertyCreated(int, QMetaPropertyBuilder &);
99
100 QDynamicMetaObjectData *parent() const;
101
102 bool checkedSetValue(int index, const QVariant &value, bool force);
103
104private:
107};
108
110
111#endif // QQMLOPENMETAOBJECT_H
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore
Definition qobject.h:103
The QQmlEngine class provides an environment for instantiating QML components.
Definition qqmlengine.h:57
\inmodule QtCore
Definition qvariant.h:65
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLuint index
[2]
GLenum GLenum GLsizei count
GLuint object
[3]
GLenum type
GLuint name
GLuint GLuint * names
static const uint base
Definition qurlidna.cpp:20
settings setValue("DataPump/bgcolor", color)
\inmodule QtCore