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
qqmlenginedebugservice.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 QQMLENGINEDEBUGSERVICE_H
6#define QQMLENGINEDEBUGSERVICE_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <private/qqmldebugservice_p.h>
20#include <private/qqmldebugserviceinterfaces_p.h>
21
22#include <QtCore/qurl.h>
23#include <QtCore/qvariant.h>
24#include <QtCore/QPointer>
25
27
28class QQmlEngine;
29class QQmlContext;
30class QQmlWatcher;
31class QDataStream;
32class QQmlDebugStatesDelegate;
33
35{
37public:
40
52
62
63 void engineAboutToBeAdded(QJSEngine *) override;
64 void engineAboutToBeRemoved(QJSEngine *) override;
65 void objectCreated(QJSEngine *, QObject *) override;
66
67 QQmlDebugStatesDelegate *statesDelegate()
68 {
69 if (!m_statesDelegate)
70 m_statesDelegate = createStatesDelegate();
71 return m_statesDelegate;
72 }
73
76
77protected:
78 void messageReceived(const QByteArray &) override;
79
80private:
81 friend class QQmlDebuggerServiceFactory;
82
83 void processMessage(const QByteArray &msg);
84 void propertyChanged(qint32 id, qint32 objectId, const QMetaProperty &property,
85 const QVariant &value);
86
87 void prepareDeferredObjects(QObject *);
88 void buildObjectList(QDataStream &, QQmlContext *,
89 const QList<QPointer<QObject> > &instances);
90 void buildObjectDump(QDataStream &, QObject *, bool, bool);
91 void buildStatesList(bool cleanList, const QList<QPointer<QObject> > &instances);
92 QQmlObjectData objectData(QObject *);
93 QQmlObjectProperty propertyData(QObject *, int);
94 QVariant valueContents(QVariant defaultValue) const;
95 bool setBinding(int objectId, const QString &propertyName, const QVariant &expression, bool isLiteralValue, QString filename = QString(), int line = -1, int column = 0);
96 bool resetBinding(int objectId, const QString &propertyName);
97 bool setMethodBody(int objectId, const QString &method, const QString &body);
98 void storeObjectIds(QObject *co);
99 QList<QObject *> objectForLocationInfo(const QString &filename, int lineNumber,
100 int columnNumber);
101
102 QList<QJSEngine *> m_engines;
103 QQmlWatcher *m_watch;
104 QQmlDebugStatesDelegate *m_statesDelegate;
105};
106QDataStream &operator<<(QDataStream &, const QQmlEngineDebugServiceImpl::QQmlObjectData &);
107QDataStream &operator>>(QDataStream &, QQmlEngineDebugServiceImpl::QQmlObjectData &);
108QDataStream &operator<<(QDataStream &, const QQmlEngineDebugServiceImpl::QQmlObjectProperty &);
109QDataStream &operator>>(QDataStream &, QQmlEngineDebugServiceImpl::QQmlObjectProperty &);
110
111QT_END_NAMESPACE
112
113#endif // QQMLENGINEDEBUGSERVICE_H
void objectCreated(QJSEngine *, QObject *) override
void engineAboutToBeAdded(QJSEngine *) override
void messageReceived(const QByteArray &) override
void engineAboutToBeRemoved(QJSEngine *) override
QQmlDebugStatesDelegate * statesDelegate()
Combined button and popup list for selecting options.
QDataStream & operator>>(QDataStream &, QQmlEngineDebugServiceImpl::QQmlObjectProperty &)
QDataStream & operator>>(QDataStream &, QQmlEngineDebugServiceImpl::QQmlObjectData &)