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
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
4#ifndef QQMLDEBUGSERVICE_H
5#define QQMLDEBUGSERVICE_H
6
7#include <QtCore/qobject.h>
8#include <QtCore/qhash.h>
9
10#include <private/qtqmlglobal_p.h>
11
12//
13// W A R N I N G
14// -------------
15//
16// This file is not part of the Qt API. It exists purely as an
17// implementation detail. This header file may change from version to
18// version without notice, or even be removed.
19//
20// We mean it.
21//
22
24
26
27class QJSEngine;
28
30class Q_QML_EXPORT QQmlDebugService : public QObject
31{
33 Q_DECLARE_PRIVATE(QQmlDebugService)
34
35public:
36 ~QQmlDebugService() override;
37
38 const QString &name() const;
39 float version() const;
40
41 enum State { NotConnected, Unavailable, Enabled };
42 State state() const;
43 void setState(State newState);
44
46 virtual void stateChanged(State) {}
47 virtual void messageReceived(const QByteArray &) {}
48
49 virtual void engineAboutToBeAdded(QJSEngine *engine) { Q_EMIT attachedToEngine(engine); }
50 virtual void engineAboutToBeRemoved(QJSEngine *engine) { Q_EMIT detachedFromEngine(engine); }
51
52 virtual void engineAdded(QJSEngine *) {}
53 virtual void engineRemoved(QJSEngine *) {}
54
55 static const QHash<int, QObject *> &objectsForIds();
56 static int idForObject(QObject *);
57 static QObject *objectForId(int id) { return objectsForIds().value(id); }
58
59protected:
60 explicit QQmlDebugService(const QString &, float version, QObject *parent = nullptr);
61
65
67 void messagesToClient(const QString &name, const QList<QByteArray> &messages);
68};
69
71
72#endif // QQMLDEBUGSERVICE_H
73
\inmodule QtCore
Definition qbytearray.h:57
The QJSEngine class provides an environment for evaluating JavaScript code.
Definition qjsengine.h:26
\inmodule QtCore
Definition qobject.h:103
virtual void stateAboutToBeChanged(State)
virtual void engineRemoved(QJSEngine *)
virtual void engineAboutToBeAdded(QJSEngine *engine)
void messageToClient(const QString &name, const QByteArray &message)
virtual void engineAboutToBeRemoved(QJSEngine *engine)
void detachedFromEngine(QJSEngine *)
virtual void engineAdded(QJSEngine *)
virtual void messageReceived(const QByteArray &)
static QObject * objectForId(int id)
virtual void stateChanged(State)
void attachedToEngine(QJSEngine *)
void messagesToClient(const QString &name, const QList< QByteArray > &messages)
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
else opt state
[0]
void newState(QList< State > &states, const char *token, const char *lexem, bool pre)
Combined button and popup list for selecting options.
GLuint GLsizei const GLchar * message
GLuint name
#define QT_REQUIRE_CONFIG(feature)
#define Q_OBJECT
#define Q_EMIT
#define Q_SIGNALS
QJSEngine engine
[0]