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
qabstractobjectregistryref_p.h
Go to the documentation of this file.
1// Copyright (C) 2026 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//
5// W A R N I N G
6// -------------
7//
8// This file is not part of the Qt API. It exists purely as an
9// implementation detail. This header file may change from version to
10// version without notice, or even be removed.
11//
12// We mean it.
13//
14
15#ifndef QABSTRACTOBJECTREGISTRYREF_P_H
16#define QABSTRACTOBJECTREGISTRYREF_P_H
17
18#include <QtQmlDesignSupport/qabstractobjectregistryref.h>
19
20#include <QtQml/qqml.h>
21
22#include <QtCore/private/qobject_p.h>
23
24QT_BEGIN_NAMESPACE
25
26class QObjectRegistrySingleton;
27class QQmlEngine;
28
29class Q_QMLDESIGNSUPPORT_EXPORT QAbstractObjectRegistryRefPrivate : public QObjectPrivate
30{
31 Q_DECLARE_PUBLIC(QAbstractObjectRegistryRef)
32
33public:
34 explicit QAbstractObjectRegistryRefPrivate(QQmlEngine *engine = nullptr);
35
36 virtual void handleObjectAdded(QObject *obj) = 0;
37 virtual void handleObjectRemoved(QObject *obj) = 0;
38
39 QString key() const;
40
41protected:
42 virtual void handleInitialObjects() = 0;
43
44 QObjectRegistrySingleton *registry() const;
45
46private:
47 static void dataAppend(QQmlListProperty<QObject> *l, QObject *o);
48 static qsizetype dataCount(QQmlListProperty<QObject> *l);
49 static QObject *dataAt(QQmlListProperty<QObject> *l, qsizetype i);
50 static void dataClear(QQmlListProperty<QObject> *l);
51 static void dataReplace(QQmlListProperty<QObject> *l, qsizetype i, QObject *o);
52 static void dataRemoveLast(QQmlListProperty<QObject> *l);
53
54 QString m_key;
55 QList<QObject *> m_data;
56 QObjectRegistrySingleton *m_registry = nullptr;
57};
58
59QT_END_NAMESPACE
60
61#endif // QABSTRACTOBJECTREGISTRYREF_P_H
Combined button and popup list for selecting options.