6#include <private/qhooks_p.h>
7#include <private/qversionedpacket_p.h>
9#include <QtQml/qjsengine.h>
10#include <QtCore/qdebug.h>
11#include <QtCore/qjsonarray.h>
12#include <QtCore/qjsondocument.h>
13#include <QtCore/qjsonobject.h>
14#include <QtCore/qjsonvalue.h>
15#include <QtCore/qpointer.h>
16#include <QtCore/qvector.h>
19#define TRACE_PROTOCOL(s)
57 responseBuffer->clear();
75 TRACE_PROTOCOL(
"Recipient: " << recipient <<
" got message: " << msg);
150 : m_blockingMode(
false)
155 for (
const QStringView &strArgument : lstjsDebugArguments) {
157 m_blockingMode =
true;
161 }
else if (strArgument.startsWith(
QLatin1String(
"services:"))) {
162 services.append(strArgument.mid(9).toString());
164 services.append(strArgument.toString());
165 }
else if (!strArgument.startsWith(
QLatin1String(
"connector:"))) {
166 qWarning(
"QML Debugger: Invalid argument \"%s\" detected. Ignoring the same.",
167 strArgument.toUtf8().constData());
184 return m_blockingMode;
191 if ((*i)->name() ==
name)
226 m_engines.removeOne(
engine);
231 return m_engines.contains(
engine);
234void QQmlNativeDebugConnector::announceObjectAvailability(
const QString &objectType,
235 QObject *
object,
bool available)
256 for (
auto it = m_services.cbegin(),
end = m_services.cend();
it !=
end; ++
it) {
257 if ((*it)->name() ==
name)
262 this, &QQmlNativeDebugConnector::sendMessage);
264 this, &QQmlNativeDebugConnector::sendMessages);
275 if ((*i)->name() ==
name) {
281 this, &QQmlNativeDebugConnector::sendMessages);
283 this, &QQmlNativeDebugConnector::sendMessage);
302 s_dataStreamVersion = version;
326 for (
int i = 0;
i != messages.
size(); ++
i)
327 sendMessage(
name, messages.
at(
i));
337#include "moc_qqmlnativedebugconnector.cpp"
std::vector< ObjCStrongReference< CBMutableService > > services
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
static QByteArray fromHex(const QByteArray &hexEncoded)
Returns a decoded copy of the hex encoded array hexEncoded.
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
static QByteArray number(int, int base=10)
Returns a byte-array representing the whole number n as text.
@ Qt_DefaultCompiledVersion
T value(const Key &key) const noexcept
The QJSEngine class provides an environment for evaluating JavaScript code.
\inmodule QtCore\reentrant
QByteArray toJson(JsonFormat format=Indented) const
void setObject(const QJsonObject &object)
Sets object as the main object of this document.
\inmodule QtCore\reentrant
iterator insert(const QString &key, const QJsonValue &value)
Inserts a new item with the key key and a value of value.
qsizetype size() const noexcept
const_reference at(qsizetype i) const noexcept
static Service * service()
static QQmlDebugConnector * instance()
void messageToClient(const QString &name, const QByteArray &message)
virtual void messageReceived(const QByteArray &)
void messagesToClient(const QString &name, const QList< QByteArray > &messages)
QQmlDebugConnector * create(const QString &key) override
bool addService(const QString &name, QQmlDebugService *service) override
static void setDataStreamVersion(int version)
void addEngine(QJSEngine *engine) override
QQmlNativeDebugConnector()
bool open(const QVariantHash &configuration) override
bool blockingMode() const override
bool hasEngine(QJSEngine *engine) const override
bool removeService(const QString &name) override
void removeEngine(QJSEngine *engine) override
~QQmlNativeDebugConnector() override
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool toBool() const
Returns the variant as a bool if the variant has userType() Bool.
QSet< QString >::iterator it
Combined button and popup list for selecting options.
#define Q_GLOBAL_STATIC(TYPE, NAME,...)
QT_BEGIN_NAMESPACE quintptr Q_CORE_EXPORT qtHookData[]
GLuint GLsizei const GLchar * message
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
Q_DECL_EXPORT int qt_qmlDebugMessageLength
static QT_USE_NAMESPACE bool expectSyncronousResponse
Q_DECL_EXPORT bool qt_qmlDebugConnectionBlocker
quintptr qt_qmlDebugTestHooks[]
Q_DECL_EXPORT void qt_qmlDebugClearBuffer()
Q_DECL_EXPORT void qt_qmlDebugConnectorOpen()
Q_DECL_EXPORT bool qt_qmlDebugEnableService(const char *data)
Q_DECL_EXPORT bool qt_qmlDebugDisableService(const char *data)
Q_DECL_EXPORT bool qt_qmlDebugSendDataToService(const char *serviceName, const char *hexData)
Q_DECL_EXPORT void qt_qmlDebugSetStreamVersion(int version)
Q_DECL_EXPORT void qt_qmlDebugMessageAvailable()
#define TRACE_PROTOCOL(s)
Q_DECL_EXPORT void qt_qmlDebugObjectAvailable()
Q_DECL_EXPORT const char * qt_qmlDebugMessageBuffer
#define qPrintable(string)
QLatin1StringView QLatin1String
#define QStringLiteral(str)
#define TRACE_PROTOCOL(x)
connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection)
myObject disconnect()
[26]
\inmodule QtCore \reentrant