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
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
11using QQmlDebugPacket = QVersionedPacket<QQmlDebugConnector>;
12
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
48
61
71
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:598
void append(parameter_type t)
Definition qlist.h:458
void clear()
Definition qlist.h:434
\inmodule QtCore
Definition qmutex.h:313
\inmodule QtCore
Definition qobject.h:103
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
int objectForId(const ObjectContainer *objectContainer, const CompiledObject &component, int id)
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
#define emit
int qint32
Definition qtypes.h:49
QReadWriteLock lock
[0]
QJSEngine engine
[0]
bool contains(const AT &t) const noexcept
Definition qlist.h:45