Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqmldesignermetaobject_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 NODEINSTANCEMETAOBJECT_H
5#define NODEINSTANCEMETAOBJECT_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
19
20#include <QQmlContext>
21#include <QScopedPointer>
22#include <private/qqmlopenmetaobject_p.h>
23#include <private/qqmlvmemetaobject_p.h>
24
25#include <QtCore/qpointer.h>
26
27#include <memory>
28
29QT_BEGIN_NAMESPACE
30
31struct MetaPropertyData;
32
34{
35public:
37
38 static void registerNotifyPropertyChangeCallBack(void (*callback)(QObject*, const QQuickDesignerSupport::PropertyName &propertyName));
39
40protected:
41 static QQmlDesignerMetaObject* getNodeInstanceMetaObject(QObject *object, QQmlEngine *engine);
42
43 void createNewDynamicProperty(const QString &name);
44 int createProperty(const char *name, const char *passAlong) override;
45 int openMetaCall(QObject *o, QMetaObject::Call _c, int _id, void **_a);
46 int metaCall(QObject *o, QMetaObject::Call _c, int _id, void **_a) override;
47 void notifyPropertyChange(int id);
48 void setValue(int id, const QVariant &value);
49 QVariant propertyWriteValue(int, const QVariant &) override;
50
51 QObject *myObject() const { return object(); }
52
54
55 int propertyOffset() const;
56
57 int count() const;
58 QByteArray name(int) const;
59
60private:
61 QQmlDesignerMetaObject(QObject *object, QQmlEngine *engine);
62 void init(QObject *);
63
64 QQmlPropertyCache::Ptr cache() const;
65
66 QPointer<QQmlContext> m_context;
67 QScopedPointer<MetaPropertyData> m_data;
68
69 friend class QQuickDesignerSupportProperties;
70};
71
72QT_END_NAMESPACE
73
74#endif // NODEINSTANCEMETAOBJECT_H
int metaCall(QObject *o, QMetaObject::Call _c, int _id, void **_a) override
void createNewDynamicProperty(const QString &name)
static QQmlDesignerMetaObject * getNodeInstanceMetaObject(QObject *object, QQmlEngine *engine)
QDynamicMetaObjectData * dynamicMetaObjectParent() const
static void registerNotifyPropertyChangeCallBack(void(*callback)(QObject *, const QQuickDesignerSupport::PropertyName &propertyName))
void setValue(int id, const QVariant &value)
QVariant propertyWriteValue(int, const QVariant &) override
int createProperty(const char *name, const char *passAlong) override
int openMetaCall(QObject *o, QMetaObject::Call _c, int _id, void **_a)
static QT_BEGIN_NAMESPACE QHash< QDynamicMetaObjectData *, bool > nodeInstanceMetaObjectList
static void(* notifyPropertyChangeCallBack)(QObject *, const QQuickDesignerSupport::PropertyName &propertyName)
std::pair< QVariant, bool > & getDataRef(int idx)
bool hasData(int idx) const
QVector< std::pair< QVariant, bool > > m_data
QVariant & getData(int idx)