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
qqmlproxymetaobject_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 QQMLPROXYMETAOBJECT_P_H
5#define QQMLPROXYMETAOBJECT_P_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 <private/qtqmlglobal_p.h>
19#include <private/qmetaobjectbuilder_p.h>
20
21#include <QtCore/QMetaObject>
22#include <QtCore/QObject>
23
24#include <private/qobject_p.h>
25
27
29{
30public:
31 struct ProxyData {
32 typedef QObject *(*CreateFunc)(QObject *);
34 CreateFunc createFunc;
37 };
38
39 QQmlProxyMetaObject(QObject *, const QList<ProxyData> *);
41
42 static constexpr int extensionObjectId(int id) noexcept
43 {
44 Q_ASSERT(id >= 0);
45 Q_ASSERT(id <= MaxExtensionCount); // MaxExtensionCount is a valid index
46 return ExtensionObjectId | id;
47 }
48
49protected:
50 int metaCall(QObject *o, QMetaObject::Call _c, int _id, void **_a) override;
51 QMetaObject *toDynamicMetaObject(QObject *) override;
52 void objectDestroyed(QObject *object) override;
53
54private:
55 QObject *getProxy(int index);
56
57 const QList<ProxyData> *metaObjects;
58 QObject **proxies;
59
63
64 // ExtensionObjectId acts as a flag for whether we should interpret a
65 // QMetaObject::CustomCall as a call to fetch the extension object (see
66 // QQmlProxyMetaObject::metaCall()). MaxExtensionCount is a limit on how
67 // many extensions we can query via such mechanism
68 enum : int {
69 MaxExtensionCount = 127, // magic number so that low bits are all '1'
70 ExtensionObjectId = ~MaxExtensionCount,
71 };
72};
73
75
76#endif // QQMLPROXYMETAOBJECT_P_H
77
\inmodule QtCore
Definition qobject.h:103
static constexpr int extensionObjectId(int id) noexcept
Combined button and popup list for selecting options.
GLuint index
[2]
GLenum GLuint id
[7]
GLuint object
[3]
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
obj metaObject() -> className()
\inmodule QtCore