5#ifndef QQMLDEBUGCONNECTOR_H
6#define QQMLDEBUGCONNECTOR_H
8#include <QtQml/qtqmlglobal.h>
9#include <QtQml/qjsengine.h>
10#include <QtCore/QVariantList>
12#if QT_CONFIG(qml_debug)
13#include <private/qqmldebugservice_p.h>
29#if !QT_CONFIG(qml_debug)
31class Q_QML_EXPORT QQmlDebugConnector
33 virtual ~QQmlDebugConnector() =
default;
35 static QQmlDebugConnector *instance() {
return nullptr; }
37 template<
class Service>
38 static Service *service() {
return nullptr; }
40 bool hasEngine(QJSEngine *)
const {
return false; }
41 void addEngine(QJSEngine *) {}
42 void removeEngine(QJSEngine *) {}
44 bool open(
const QVariantHash &configuration = QVariantHash())
46 Q_UNUSED(configuration);
53class QQmlDebugService;
54class Q_QML_EXPORT QQmlDebugConnector :
public QObject
58 static void setPluginKey(
const QString &key);
59 static void setServices(
const QStringList &services);
60 static QQmlDebugConnector *instance();
61 static int dataStreamVersion()
63 return s_dataStreamVersion;
66 virtual bool blockingMode()
const = 0;
68 virtual QQmlDebugService *service(
const QString &name)
const = 0;
70 virtual void addEngine(QJSEngine *engine) = 0;
71 virtual void removeEngine(QJSEngine *engine) = 0;
72 virtual bool hasEngine(QJSEngine *engine)
const = 0;
74 virtual bool addService(
const QString &name, QQmlDebugService *service) = 0;
75 virtual bool removeService(
const QString &name) = 0;
77 virtual bool open(
const QVariantHash &configuration = QVariantHash()) = 0;
79 template<
class Service>
80 static Service *service()
82 QQmlDebugConnector *inst = instance();
83 return inst ?
static_cast<Service *>(inst->service(Service::s_key)) :
nullptr;
87 static QString commandLineArguments();
88 static int s_dataStreamVersion;
91class Q_QML_EXPORT QQmlDebugConnectorFactory :
public QObject {
94 virtual QQmlDebugConnector *create(
const QString &key) = 0;
95 ~QQmlDebugConnectorFactory() override;
98#define QQmlDebugConnectorFactory_iid "org.qt-project.Qt.QQmlDebugConnectorFactory"
#define Q_ATOMIC_FLAG_INIT
static Q_CONSTINIT std::atomic_flag s_printedWarning
QT_REQUIRE_CONFIG(qml_debug)
QDebug Q_QML_EXPORT operator<<(QDebug debug, const QQmlError &error)
Q_STATIC_ASSERT(sizeof(SharedImageHeader) % 4==0)