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
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
30
31class QWindow;
32class QQuickWindow;
33
34
35#if !QT_CONFIG(qml_debug)
36
37class TranslationBindingInformation;
38
40{
41public:
42 void signalEmitted(const QString &) {}
43};
44
46{
47public:
48 void startProfiling(QJSEngine *engine, quint64 features = std::numeric_limits<quint64>::max())
49 {
51 Q_UNUSED(features);
52 }
53
55};
56
63
70
75public:
76 virtual void foundTranslationBinding(const TranslationBindingInformation &) {}
77};
78
79#else
80
81class Q_QML_EXPORT QV4DebugService : public QQmlDebugService
82{
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
99class Q_QML_EXPORT QQmlProfilerService : public QQmlDebugService
100{
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 QQmlEngineDebugService : public QQmlDebugService
124{
126public:
127 ~QQmlEngineDebugService() override;
128
129 static const QString s_key;
130
131 virtual void objectCreated(QJSEngine *engine, QObject *object) = 0;
132 static void setStatesDelegateFactory(QQmlDebugStatesDelegate *(*factory)());
133 static QQmlDebugStatesDelegate *createStatesDelegate();
134
135protected:
136 friend class QQmlDebugConnector;
137
138 explicit QQmlEngineDebugService(float version, QObject *parent = nullptr) :
139 QQmlDebugService(s_key, version, parent) {}
140
141 QQmlBoundSignal *nextSignal(QQmlBoundSignal *prev) { return prev->m_nextSignal; }
142};
143
144#if QT_CONFIG(translation)
145struct TranslationBindingInformation
146{
147 static const TranslationBindingInformation
148 create(const QQmlRefPointer<QV4::ExecutableCompilationUnit> &compilationUnit,
149 const QV4::CompiledData::Binding *binding, QObject *scopeObject,
150 QQmlRefPointer<QQmlContextData> ctxt);
151
152 QQmlRefPointer<QV4::ExecutableCompilationUnit> compilationUnit;
153 QObject *scopeObject;
154 QQmlRefPointer<QQmlContextData> ctxt;
155
156 QString propertyName;
157 QQmlTranslation translation;
158
161};
162
163class Q_QML_EXPORT QQmlDebugTranslationService : public QQmlDebugService
164{
166public:
168
169 static const QString s_key;
170
171 virtual void foundTranslationBinding(const TranslationBindingInformation &translationBindingInformation) = 0;
172protected:
173 friend class QQmlDebugConnector;
174
175 explicit QQmlDebugTranslationService(float version, QObject *parent = nullptr) :
176 QQmlDebugService(s_key, version, parent) {}
177
178};
179#endif //QT_CONFIG(translation)
180
181class Q_QML_EXPORT QQmlInspectorService : public QQmlDebugService
182{
184public:
185 ~QQmlInspectorService() override;
186
187 static const QString s_key;
188
189 virtual void addWindow(QQuickWindow *) = 0;
190 virtual void setParentWindow(QQuickWindow *, QWindow *) = 0;
191 virtual void removeWindow(QQuickWindow *) = 0;
192
193protected:
194 friend class QQmlDebugConnector;
195
196 explicit QQmlInspectorService(float version, QObject *parent = nullptr) :
197 QQmlDebugService(s_key, version, parent) {}
198};
199
200class Q_QML_EXPORT QDebugMessageService : public QQmlDebugService
201{
203public:
204 ~QDebugMessageService() override;
205
206 static const QString s_key;
207
208 virtual void synchronizeTime(const QElapsedTimer &otherTimer) = 0;
209
210protected:
211 friend class QQmlDebugConnector;
212
213 explicit QDebugMessageService(float version, QObject *parent = nullptr) :
214 QQmlDebugService(s_key, version, parent) {}
215};
216
217class Q_QML_EXPORT QQmlEngineControlService : public QQmlDebugService
218{
220public:
221 ~QQmlEngineControlService() override;
222
223 static const QString s_key;
224
225protected:
226 friend class QQmlDebugConnector;
227
228 QQmlEngineControlService(float version, QObject *parent = nullptr) :
229 QQmlDebugService(s_key, version, parent) {}
230
231};
232
233class Q_QML_EXPORT QQmlNativeDebugService : public QQmlDebugService
234{
236public:
237 ~QQmlNativeDebugService() override;
238
239 static const QString s_key;
240
241protected:
242 friend class QQmlDebugConnector;
243
244 explicit QQmlNativeDebugService(float version, QObject *parent = nullptr)
245 : QQmlDebugService(s_key, version, parent) {}
246};
247
248#endif
249
251
252#endif // QQMLDEBUGSERVICEINTERFACES_P_H
253
\inmodule QtCore
The QJSEngine class provides an environment for evaluating JavaScript code.
Definition qjsengine.h:26
\inmodule QtCore
Definition qobject.h:103
virtual void foundTranslationBinding(const TranslationBindingInformation &)
void objectCreated(QJSEngine *, QObject *)
static void setStatesDelegateFactory(QQmlDebugStatesDelegate *(*)())
void setParentWindow(QQuickWindow *, QWindow *)
void startProfiling(QJSEngine *engine, quint64 features=std::numeric_limits< quint64 >::max())
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
void signalEmitted(const QString &)
\inmodule QtGui
Definition qwindow.h:63
auto signal
Combined button and popup list for selecting options.
GLenum GLenum GLsizei void GLsizei void * column
#define Q_OBJECT
#define Q_UNUSED(x)
unsigned int quint32
Definition qtypes.h:50
unsigned long long quint64
Definition qtypes.h:61
QItemEditorFactory * factory
view create()
QJSEngine engine
[0]