Qt 6.x
The Qt SDK
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
qqmlenginecontrolservice.cpp
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
5#include <private/qqmldebugconnector_p.h>
6#include <private/qversionedpacket_p.h>
7#include <QJSEngine>
8
10
12
15{
17}
18
20{
23 qint32 command;
24 qint32 engineId;
25 d >> command >> engineId;
26 QJSEngine *engine = qobject_cast<QJSEngine *>(objectForId(engineId));
29 emit attachedToEngine(engine);
30 } else if (command == StopWaitingEngine && stoppingEngines.contains(engine)) {
32 emit detachedFromEngine(engine);
33 }
34}
35
37{
39 if (blockingMode && state() == Enabled) {
44 } else {
45 emit attachedToEngine(engine);
46 }
47}
48
50{
52 if (blockingMode && state() == Enabled) {
57 } else {
58 emit detachedFromEngine(engine);
59 }
60}
61
63{
64 if (state() == Enabled) {
69 }
70}
71
73{
74 if (state() == Enabled) {
79 }
80}
81
84{
86 d << static_cast<qint32>(type) << idForObject(engine);
87 emit messageToClient(name(), d.data());
88}
89
91{
92 // We flush everything for any kind of state change, to avoid complicated timing issues.
94 for (QJSEngine *engine : std::as_const(startingEngines))
95 emit attachedToEngine(engine);
97 for (QJSEngine *engine : std::as_const(stoppingEngines))
98 emit detachedFromEngine(engine);
100}
101
\inmodule QtCore
Definition qbytearray.h:57
The QJSEngine class provides an environment for evaluating JavaScript code.
Definition qjsengine.h:26
bool removeOne(const AT &t)
Definition qlist.h:581
void append(parameter_type t)
Definition qlist.h:441
void clear()
Definition qlist.h:417
\inmodule QtCore
Definition qmutex.h:317
\inmodule QtCore
Definition qobject.h:90
static QQmlDebugConnector * instance()
void engineRemoved(QJSEngine *) override
void engineAboutToBeRemoved(QJSEngine *) override
void engineAdded(QJSEngine *) override
void messageReceived(const QByteArray &) override
void sendMessage(MessageType type, QJSEngine *engine)
void engineAboutToBeAdded(QJSEngine *) override
QQmlEngineControlServiceImpl(QObject *parent=nullptr)
else opt state
[0]
Combined button and popup list for selecting options.
GLenum type
GLuint GLsizei const GLchar * message
GLuint name
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
#define emit
int qint32
Definition qtypes.h:44
QReadWriteLock lock
[0]
QJSEngine engine
[0]
bool contains(const AT &t) const noexcept
Definition qlist.h:44
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent