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