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
qqmldebugconnector_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// Qt-Security score:significant
4
5#ifndef QQMLDEBUGCONNECTOR_H
6#define QQMLDEBUGCONNECTOR_H
7
8#include <QtQml/qtqmlglobal.h>
9#include <QtQml/qjsengine.h>
10#include <QtCore/QVariantList>
11
12#if QT_CONFIG(qml_debug)
13#include <private/qqmldebugservice_p.h>
14#endif
15
16//
17// W A R N I N G
18// -------------
19//
20// This file is not part of the Qt API. It exists purely as an
21// implementation detail. This header file may change from version to
22// version without notice, or even be removed.
23//
24// We mean it.
25//
26
27QT_BEGIN_NAMESPACE
28
29#if !QT_CONFIG(qml_debug)
30
31class Q_QML_EXPORT QQmlDebugConnector
32{
33 virtual ~QQmlDebugConnector() = default; // don't break 'override' on ~QQmlDebugServer
34public:
35 static QQmlDebugConnector *instance() { return nullptr; }
36
37 template<class Service>
38 static Service *service() { return nullptr; }
39
40 bool hasEngine(QJSEngine *) const { return false; }
41 void addEngine(QJSEngine *) {}
42 void removeEngine(QJSEngine *) {}
43
44 bool open(const QVariantHash &configuration = QVariantHash())
45 {
46 Q_UNUSED(configuration);
47 return false;
48 }
49};
50
51#else
52
53class QQmlDebugService;
54class Q_QML_EXPORT QQmlDebugConnector : public QObject
55{
56 Q_OBJECT
57public:
58 static void setPluginKey(const QString &key);
59 static void setServices(const QStringList &services);
60 static QQmlDebugConnector *instance();
61 static int dataStreamVersion()
62 {
63 return s_dataStreamVersion;
64 }
65
66 virtual bool blockingMode() const = 0;
67
68 virtual QQmlDebugService *service(const QString &name) const = 0;
69
70 virtual void addEngine(QJSEngine *engine) = 0;
71 virtual void removeEngine(QJSEngine *engine) = 0;
72 virtual bool hasEngine(QJSEngine *engine) const = 0;
73
74 virtual bool addService(const QString &name, QQmlDebugService *service) = 0;
75 virtual bool removeService(const QString &name) = 0;
76
77 virtual bool open(const QVariantHash &configuration = QVariantHash()) = 0;
78
79 template<class Service>
80 static Service *service()
81 {
82 QQmlDebugConnector *inst = instance();
83 return inst ? static_cast<Service *>(inst->service(Service::s_key)) : nullptr;
84 }
85
86protected:
87 static QString commandLineArguments();
88 static int s_dataStreamVersion;
89};
90
91class Q_QML_EXPORT QQmlDebugConnectorFactory : public QObject {
92 Q_OBJECT
93public:
94 virtual QQmlDebugConnector *create(const QString &key) = 0;
95 ~QQmlDebugConnectorFactory() override;
96};
97
98#define QQmlDebugConnectorFactory_iid "org.qt-project.Qt.QQmlDebugConnectorFactory"
99
100#endif
101
102QT_END_NAMESPACE
103
104#endif // QQMLDEBUGCONNECTOR_H
\inmodule QtSql
@ HookCount
#define Q_ATOMIC_FLAG_INIT
Definition qqmldebug.cpp:22
static Q_CONSTINIT std::atomic_flag s_printedWarning
Definition qqmldebug.cpp:40
QT_REQUIRE_CONFIG(qml_debug)
QDebug Q_QML_EXPORT operator<<(QDebug debug, const QQmlError &error)
Q_STATIC_ASSERT(sizeof(SharedImageHeader) % 4==0)