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
qqmldebugserviceinterfaces_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 QQMLDEBUGSERVICEINTERFACES_P_H
6#define QQMLDEBUGSERVICEINTERFACES_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtCore/qstring.h>
20#include <private/qtqmlglobal_p.h>
21#if QT_CONFIG(qml_debug)
22#include <private/qqmldebugservice_p.h>
23#endif
24#include <private/qqmldebugstatesdelegate_p.h>
25#include <private/qqmlboundsignal_p.h>
26#include <private/qqmltranslation_p.h>
27
28#include <limits>
29
30QT_BEGIN_NAMESPACE
31
32class QWindow;
33class QQuickWindow;
34
35
36#if !QT_CONFIG(qml_debug)
37
38class TranslationBindingInformation;
39
40class QV4DebugService
41{
42public:
43 void signalEmitted(const QString &) {}
44};
45
46class QQmlProfilerService
47{
48public:
49 void startProfiling(QJSEngine *engine, quint64 features = std::numeric_limits<quint64>::max())
50 {
51 Q_UNUSED(engine);
52 Q_UNUSED(features);
53 }
54
55 void stopProfiling(QJSEngine *) {}
56};
57
58class QQmlEngineDebugService
59{
60public:
61 void objectCreated(QJSEngine *, QObject *) {}
62 static void setStatesDelegateFactory(QQmlDebugStatesDelegate *(*)()) {}
63};
64
65class QQmlInspectorService {
66public:
67 void addWindow(QQuickWindow *) {}
68 void setParentWindow(QQuickWindow *, QWindow *) {}
69 void removeWindow(QQuickWindow *) {}
70};
71
72class QDebugMessageService {};
73class QQmlEngineControlService {};
74class QQmlNativeDebugService {};
75class QQmlDebugTranslationService {
76public:
77 virtual void foundTranslationBinding(const TranslationBindingInformation &) {}
78};
79
80#else
81
82class Q_QML_EXPORT QV4DebugService : public QQmlDebugService
83{
84 Q_OBJECT
85public:
86 ~QV4DebugService() override;
87
88 static const QString s_key;
89
90 virtual void signalEmitted(const QString &signal) = 0;
91
92protected:
93 friend class QQmlDebugConnector;
94
95 explicit QV4DebugService(float version, QObject *parent = nullptr) :
96 QQmlDebugService(s_key, version, parent) {}
97};
98
99class QQmlAbstractProfilerAdapter;
100class Q_QML_EXPORT QQmlProfilerService : public QQmlDebugService
101{
102 Q_OBJECT
103public:
104 ~QQmlProfilerService() override;
105
106 static const QString s_key;
107
108 virtual void addGlobalProfiler(QQmlAbstractProfilerAdapter *profiler) = 0;
109 virtual void removeGlobalProfiler(QQmlAbstractProfilerAdapter *profiler) = 0;
110
111 virtual void startProfiling(QJSEngine *engine,
112 quint64 features = std::numeric_limits<quint64>::max()) = 0;
113 virtual void stopProfiling(QJSEngine *engine) = 0;
114
115 virtual void dataReady(QQmlAbstractProfilerAdapter *profiler) = 0;
116
117protected:
118 friend class QQmlDebugConnector;
119
120 explicit QQmlProfilerService(float version, QObject *parent = nullptr) :
121 QQmlDebugService(s_key, version, parent) {}
122};
123
124class Q_QML_EXPORT QQuickEventReplayService : public QQmlDebugService
125{
126 Q_OBJECT
127public:
128 ~QQuickEventReplayService() override;
129
130 static const QString s_key;
131
132protected:
133 friend class QQmlDebugConnector;
134
135 explicit QQuickEventReplayService(float version, QObject *parent = nullptr) :
136 QQmlDebugService(s_key, version, parent) {}
137};
138
139class Q_QML_EXPORT QQmlEngineDebugService : public QQmlDebugService{
140 Q_OBJECT
141public:
142 ~QQmlEngineDebugService() override;
143
144 static const QString s_key;
145
146 virtual void objectCreated(QJSEngine *engine, QObject *object) = 0;
147 static void setStatesDelegateFactory(QQmlDebugStatesDelegate *(*factory)());
148 static QQmlDebugStatesDelegate *createStatesDelegate();
149
150protected:
151 friend class QQmlDebugConnector;
152
153 explicit QQmlEngineDebugService(float version, QObject *parent = nullptr) :
154 QQmlDebugService(s_key, version, parent) {}
155
156 QQmlBoundSignal *nextSignal(QQmlBoundSignal *prev) { return prev->m_nextSignal; }
157};
158
159#if QT_CONFIG(translation)
160struct TranslationBindingInformation
161{
162 static const TranslationBindingInformation
163 create(const QQmlRefPointer<QV4::ExecutableCompilationUnit> &compilationUnit,
164 const QV4::CompiledData::Binding *binding, QObject *scopeObject,
165 QQmlRefPointer<QQmlContextData> ctxt);
166
167 QQmlRefPointer<QV4::ExecutableCompilationUnit> compilationUnit;
168 QObject *scopeObject;
169 QQmlRefPointer<QQmlContextData> ctxt;
170
171 QString propertyName;
172 QQmlTranslation translation;
173
174 quint32 line;
175 quint32 column;
176};
177
178class Q_QML_EXPORT QQmlDebugTranslationService : public QQmlDebugService
179{
180 Q_OBJECT
181public:
182 ~QQmlDebugTranslationService() override;
183
184 static const QString s_key;
185
186 virtual void foundTranslationBinding(const TranslationBindingInformation &translationBindingInformation) = 0;
187protected:
188 friend class QQmlDebugConnector;
189
190 explicit QQmlDebugTranslationService(float version, QObject *parent = nullptr) :
191 QQmlDebugService(s_key, version, parent) {}
192
193};
194#endif //QT_CONFIG(translation)
195
196class Q_QML_EXPORT QQmlInspectorService : public QQmlDebugService
197{
198 Q_OBJECT
199public:
200 ~QQmlInspectorService() override;
201
202 static const QString s_key;
203
204 virtual void addWindow(QQuickWindow *) = 0;
205 virtual void setParentWindow(QQuickWindow *, QWindow *) = 0;
206 virtual void removeWindow(QQuickWindow *) = 0;
207
208protected:
209 friend class QQmlDebugConnector;
210
211 explicit QQmlInspectorService(float version, QObject *parent = nullptr) :
212 QQmlDebugService(s_key, version, parent) {}
213};
214
215class Q_QML_EXPORT QDebugMessageService : public QQmlDebugService
216{
217 Q_OBJECT
218public:
219 ~QDebugMessageService() override;
220
221 static const QString s_key;
222
223 virtual void synchronizeTime(const QElapsedTimer &otherTimer) = 0;
224
225protected:
226 friend class QQmlDebugConnector;
227
228 explicit QDebugMessageService(float version, QObject *parent = nullptr) :
229 QQmlDebugService(s_key, version, parent) {}
230};
231
232class Q_QML_EXPORT QQmlEngineControlService : public QQmlDebugService
233{
234 Q_OBJECT
235public:
236 ~QQmlEngineControlService() override;
237
238 static const QString s_key;
239
240protected:
241 friend class QQmlDebugConnector;
242
243 QQmlEngineControlService(float version, QObject *parent = nullptr) :
244 QQmlDebugService(s_key, version, parent) {}
245
246};
247
248class Q_QML_EXPORT QQmlNativeDebugService : public QQmlDebugService
249{
250 Q_OBJECT
251public:
252 ~QQmlNativeDebugService() override;
253
254 static const QString s_key;
255
256protected:
257 friend class QQmlDebugConnector;
258
259 explicit QQmlNativeDebugService(float version, QObject *parent = nullptr)
260 : QQmlDebugService(s_key, version, parent) {}
261};
262
263#endif
264
265QT_END_NAMESPACE
266
267#endif // QQMLDEBUGSERVICEINTERFACES_P_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)