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