Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqmldebugservice_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// Qt-Security score:significant
4
5#ifndef QQMLDEBUGSERVICE_H
6#define QQMLDEBUGSERVICE_H
7
8#include <QtCore/qobject.h>
9#include <QtCore/qhash.h>
10
11#include <private/qtqmlglobal_p.h>
12
13//
14// W A R N I N G
15// -------------
16//
17// This file is not part of the Qt API. It exists purely as an
18// implementation detail. This header file may change from version to
19// version without notice, or even be removed.
20//
21// We mean it.
22//
23
25
26QT_BEGIN_NAMESPACE
27
28class QJSEngine;
29
31class Q_QML_EXPORT QQmlDebugService : public QObject
32{
33 Q_OBJECT
34 Q_DECLARE_PRIVATE(QQmlDebugService)
35
36public:
37 ~QQmlDebugService() override;
38
39 const QString &name() const;
40 float version() const;
41
42 enum State { NotConnected, Unavailable, Enabled };
43 State state() const;
44 void setState(State newState);
45
46 virtual void stateAboutToBeChanged(State) {}
47 virtual void stateChanged(State) {}
48 virtual void messageReceived(const QByteArray &) {}
49
50 virtual void engineAboutToBeAdded(QJSEngine *engine) { Q_EMIT attachedToEngine(engine); }
51 virtual void engineAboutToBeRemoved(QJSEngine *engine) { Q_EMIT detachedFromEngine(engine); }
52
53 virtual void engineAdded(QJSEngine *) {}
54 virtual void engineRemoved(QJSEngine *) {}
55
56 static const QHash<int, QObject *> &objectsForIds();
57 static int idForObject(QObject *);
58 static QObject *objectForId(int id) { return objectsForIds().value(id); }
59
60protected:
61 explicit QQmlDebugService(const QString &, float version, QObject *parent = nullptr);
62
63Q_SIGNALS:
64 void attachedToEngine(QJSEngine *);
65 void detachedFromEngine(QJSEngine *);
66
67 void messageToClient(const QString &name, const QByteArray &message);
68 void messagesToClient(const QString &name, const QList<QByteArray> &messages);
69};
70
71QT_END_NAMESPACE
72
73#endif // QQMLDEBUGSERVICE_H
\inmodule QtQml
\inmodule QtSql
Combined button and popup list for selecting options.
QT_REQUIRE_CONFIG(liburing)
#define Q_QML_DEBUG_PLUGIN_LOADER(interfaceName)
QQmlDebugConnector * instance