QmlEngineDebug: Rename to QmlEngineDebugClient in AutoTest
Change-Id: If20b53d2e47cdc4ed54df0d9360ae1b0566489c6 Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
parent
f3bec84894
commit
7f963aa41d
|
@ -39,9 +39,7 @@
|
||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "qqmlenginedebug_p.h"
|
#include "qqmlenginedebugclient.h"
|
||||||
|
|
||||||
#include "qqmldebugclient.h"
|
|
||||||
|
|
||||||
struct QmlObjectData {
|
struct QmlObjectData {
|
||||||
QUrl url;
|
QUrl url;
|
||||||
|
@ -80,42 +78,26 @@ QDataStream &operator>>(QDataStream &ds, QmlObjectProperty &data)
|
||||||
return ds;
|
return ds;
|
||||||
}
|
}
|
||||||
|
|
||||||
class QQmlEngineDebugClient : public QQmlDebugClient
|
class QQmlEngineDebugClientPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QQmlEngineDebugClient(QQmlDebugConnection *client, QQmlEngineDebugPrivate *p);
|
QQmlEngineDebugClientPrivate(QQmlEngineDebugClient *);
|
||||||
|
~QQmlEngineDebugClientPrivate();
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual void stateChanged(State state);
|
|
||||||
virtual void messageReceived(const QByteArray &);
|
|
||||||
|
|
||||||
private:
|
|
||||||
QQmlEngineDebugPrivate *priv;
|
|
||||||
friend class QQmlEngineDebugPrivate;
|
|
||||||
};
|
|
||||||
|
|
||||||
class QQmlEngineDebugPrivate
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
QQmlEngineDebugPrivate(QQmlEngineDebug *, QQmlDebugConnection *);
|
|
||||||
~QQmlEngineDebugPrivate();
|
|
||||||
|
|
||||||
void stateChanged(QQmlEngineDebug::State status);
|
|
||||||
void message(const QByteArray &);
|
void message(const QByteArray &);
|
||||||
|
|
||||||
QQmlEngineDebug *q;
|
QQmlEngineDebugClient *q;
|
||||||
QQmlEngineDebugClient *client;
|
|
||||||
int nextId;
|
int nextId;
|
||||||
int getId();
|
int getId();
|
||||||
|
|
||||||
void decode(QDataStream &, QQmlDebugContextReference &);
|
void decode(QDataStream &, QQmlDebugContextReference &);
|
||||||
void decode(QDataStream &, QQmlDebugObjectReference &, bool simple);
|
void decode(QDataStream &, QQmlDebugObjectReference &, bool simple);
|
||||||
|
|
||||||
static void remove(QQmlEngineDebug *, QQmlDebugEnginesQuery *);
|
static void remove(QQmlEngineDebugClient *, QQmlDebugEnginesQuery *);
|
||||||
static void remove(QQmlEngineDebug *, QQmlDebugRootContextQuery *);
|
static void remove(QQmlEngineDebugClient *, QQmlDebugRootContextQuery *);
|
||||||
static void remove(QQmlEngineDebug *, QQmlDebugObjectQuery *);
|
static void remove(QQmlEngineDebugClient *, QQmlDebugObjectQuery *);
|
||||||
static void remove(QQmlEngineDebug *, QQmlDebugExpressionQuery *);
|
static void remove(QQmlEngineDebugClient *, QQmlDebugExpressionQuery *);
|
||||||
static void remove(QQmlEngineDebug *, QQmlDebugWatch *);
|
static void remove(QQmlEngineDebugClient *, QQmlDebugWatch *);
|
||||||
|
|
||||||
QHash<int, QQmlDebugEnginesQuery *> enginesQuery;
|
QHash<int, QQmlDebugEnginesQuery *> enginesQuery;
|
||||||
QHash<int, QQmlDebugRootContextQuery *> rootContextQuery;
|
QHash<int, QQmlDebugRootContextQuery *> rootContextQuery;
|
||||||
|
@ -125,36 +107,24 @@ public:
|
||||||
QHash<int, QQmlDebugWatch *> watched;
|
QHash<int, QQmlDebugWatch *> watched;
|
||||||
};
|
};
|
||||||
|
|
||||||
QQmlEngineDebugClient::QQmlEngineDebugClient(QQmlDebugConnection *client,
|
|
||||||
QQmlEngineDebugPrivate *p)
|
|
||||||
: QQmlDebugClient(QLatin1String("QmlDebugger"), client), priv(p)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void QQmlEngineDebugClient::stateChanged(State status)
|
void QQmlEngineDebugClient::stateChanged(State status)
|
||||||
{
|
{
|
||||||
if (priv)
|
emit newState(status);
|
||||||
priv->stateChanged(static_cast<QQmlEngineDebug::State>(status));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQmlEngineDebugClient::messageReceived(const QByteArray &data)
|
void QQmlEngineDebugClient::messageReceived(const QByteArray &data)
|
||||||
{
|
{
|
||||||
if (priv)
|
d->message(data);
|
||||||
priv->message(data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QQmlEngineDebugPrivate::QQmlEngineDebugPrivate(QQmlEngineDebug *p, QQmlDebugConnection *c)
|
QQmlEngineDebugClientPrivate::QQmlEngineDebugClientPrivate(QQmlEngineDebugClient *p)
|
||||||
: q(p),
|
: q(p),
|
||||||
client(new QQmlEngineDebugClient(c, this)), nextId(0)
|
nextId(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QQmlEngineDebugPrivate::~QQmlEngineDebugPrivate()
|
QQmlEngineDebugClientPrivate::~QQmlEngineDebugClientPrivate()
|
||||||
{
|
{
|
||||||
if (client)
|
|
||||||
client->priv = 0;
|
|
||||||
delete client;
|
|
||||||
|
|
||||||
QHash<int, QQmlDebugEnginesQuery*>::iterator enginesIter = enginesQuery.begin();
|
QHash<int, QQmlDebugEnginesQuery*>::iterator enginesIter = enginesQuery.begin();
|
||||||
for (; enginesIter != enginesQuery.end(); ++enginesIter) {
|
for (; enginesIter != enginesQuery.end(); ++enginesIter) {
|
||||||
enginesIter.value()->m_client = 0;
|
enginesIter.value()->m_client = 0;
|
||||||
|
@ -190,53 +160,53 @@ QQmlEngineDebugPrivate::~QQmlEngineDebugPrivate()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int QQmlEngineDebugPrivate::getId()
|
int QQmlEngineDebugClientPrivate::getId()
|
||||||
{
|
{
|
||||||
return nextId++;
|
return nextId++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQmlEngineDebugPrivate::remove(QQmlEngineDebug *c, QQmlDebugEnginesQuery *q)
|
void QQmlEngineDebugClientPrivate::remove(QQmlEngineDebugClient *c, QQmlDebugEnginesQuery *q)
|
||||||
{
|
{
|
||||||
if (c && q) {
|
if (c && q) {
|
||||||
QQmlEngineDebugPrivate *p = c->getPrivate();
|
QQmlEngineDebugClientPrivate *p = c->getPrivate();
|
||||||
p->enginesQuery.remove(q->m_queryId);
|
p->enginesQuery.remove(q->m_queryId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQmlEngineDebugPrivate::remove(QQmlEngineDebug *c,
|
void QQmlEngineDebugClientPrivate::remove(QQmlEngineDebugClient *c,
|
||||||
QQmlDebugRootContextQuery *q)
|
QQmlDebugRootContextQuery *q)
|
||||||
{
|
{
|
||||||
if (c && q) {
|
if (c && q) {
|
||||||
QQmlEngineDebugPrivate *p = c->getPrivate();
|
QQmlEngineDebugClientPrivate *p = c->getPrivate();
|
||||||
p->rootContextQuery.remove(q->m_queryId);
|
p->rootContextQuery.remove(q->m_queryId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQmlEngineDebugPrivate::remove(QQmlEngineDebug *c, QQmlDebugObjectQuery *q)
|
void QQmlEngineDebugClientPrivate::remove(QQmlEngineDebugClient *c, QQmlDebugObjectQuery *q)
|
||||||
{
|
{
|
||||||
if (c && q) {
|
if (c && q) {
|
||||||
QQmlEngineDebugPrivate *p = c->getPrivate();
|
QQmlEngineDebugClientPrivate *p = c->getPrivate();
|
||||||
p->objectQuery.remove(q->m_queryId);
|
p->objectQuery.remove(q->m_queryId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQmlEngineDebugPrivate::remove(QQmlEngineDebug *c, QQmlDebugExpressionQuery *q)
|
void QQmlEngineDebugClientPrivate::remove(QQmlEngineDebugClient *c, QQmlDebugExpressionQuery *q)
|
||||||
{
|
{
|
||||||
if (c && q) {
|
if (c && q) {
|
||||||
QQmlEngineDebugPrivate *p = c->getPrivate();
|
QQmlEngineDebugClientPrivate *p = c->getPrivate();
|
||||||
p->expressionQuery.remove(q->m_queryId);
|
p->expressionQuery.remove(q->m_queryId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQmlEngineDebugPrivate::remove(QQmlEngineDebug *c, QQmlDebugWatch *w)
|
void QQmlEngineDebugClientPrivate::remove(QQmlEngineDebugClient *c, QQmlDebugWatch *w)
|
||||||
{
|
{
|
||||||
if (c && w) {
|
if (c && w) {
|
||||||
QQmlEngineDebugPrivate *p = c->getPrivate();
|
QQmlEngineDebugClientPrivate *p = c->getPrivate();
|
||||||
p->watched.remove(w->m_queryId);
|
p->watched.remove(w->m_queryId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQmlEngineDebugPrivate::decode(QDataStream &ds, QQmlDebugObjectReference &o,
|
void QQmlEngineDebugClientPrivate::decode(QDataStream &ds, QQmlDebugObjectReference &o,
|
||||||
bool simple)
|
bool simple)
|
||||||
{
|
{
|
||||||
QmlObjectData data;
|
QmlObjectData data;
|
||||||
|
@ -296,7 +266,7 @@ void QQmlEngineDebugPrivate::decode(QDataStream &ds, QQmlDebugObjectReference &o
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQmlEngineDebugPrivate::decode(QDataStream &ds, QQmlDebugContextReference &c)
|
void QQmlEngineDebugClientPrivate::decode(QDataStream &ds, QQmlDebugContextReference &c)
|
||||||
{
|
{
|
||||||
ds >> c.m_name >> c.m_debugId;
|
ds >> c.m_name >> c.m_debugId;
|
||||||
|
|
||||||
|
@ -320,12 +290,7 @@ void QQmlEngineDebugPrivate::decode(QDataStream &ds, QQmlDebugContextReference &
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQmlEngineDebugPrivate::stateChanged(QQmlEngineDebug::State status)
|
void QQmlEngineDebugClientPrivate::message(const QByteArray &data)
|
||||||
{
|
|
||||||
emit q->stateChanged(status);
|
|
||||||
}
|
|
||||||
|
|
||||||
void QQmlEngineDebugPrivate::message(const QByteArray &data)
|
|
||||||
{
|
{
|
||||||
QDataStream ds(data);
|
QDataStream ds(data);
|
||||||
|
|
||||||
|
@ -448,26 +413,21 @@ void QQmlEngineDebugPrivate::message(const QByteArray &data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QQmlEngineDebug::QQmlEngineDebug(QQmlDebugConnection *client, QObject *parent)
|
QQmlEngineDebugClient::QQmlEngineDebugClient(QQmlDebugConnection *client)
|
||||||
: QObject(parent),
|
: QQmlDebugClient(QLatin1String("QmlDebugger"), client),
|
||||||
d(new QQmlEngineDebugPrivate(this, client))
|
d(new QQmlEngineDebugClientPrivate(this))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QQmlEngineDebug::~QQmlEngineDebug()
|
QQmlEngineDebugClient::~QQmlEngineDebugClient()
|
||||||
{
|
{
|
||||||
delete d;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
QQmlEngineDebug::State QQmlEngineDebug::state() const
|
QQmlDebugPropertyWatch *QQmlEngineDebugClient::addWatch(const QQmlDebugPropertyReference &property, QObject *parent)
|
||||||
{
|
|
||||||
return static_cast<QQmlEngineDebug::State>(d->client->state());
|
|
||||||
}
|
|
||||||
|
|
||||||
QQmlDebugPropertyWatch *QQmlEngineDebug::addWatch(const QQmlDebugPropertyReference &property, QObject *parent)
|
|
||||||
{
|
{
|
||||||
QQmlDebugPropertyWatch *watch = new QQmlDebugPropertyWatch(parent);
|
QQmlDebugPropertyWatch *watch = new QQmlDebugPropertyWatch(parent);
|
||||||
if (d->client->state() == QQmlDebugClient::Enabled) {
|
if (state() == QQmlDebugClient::Enabled) {
|
||||||
int queryId = d->getId();
|
int queryId = d->getId();
|
||||||
watch->m_queryId = queryId;
|
watch->m_queryId = queryId;
|
||||||
watch->m_client = this;
|
watch->m_client = this;
|
||||||
|
@ -478,7 +438,7 @@ QQmlDebugPropertyWatch *QQmlEngineDebug::addWatch(const QQmlDebugPropertyReferen
|
||||||
QByteArray message;
|
QByteArray message;
|
||||||
QDataStream ds(&message, QIODevice::WriteOnly);
|
QDataStream ds(&message, QIODevice::WriteOnly);
|
||||||
ds << QByteArray("WATCH_PROPERTY") << queryId << property.objectDebugId() << property.name().toUtf8();
|
ds << QByteArray("WATCH_PROPERTY") << queryId << property.objectDebugId() << property.name().toUtf8();
|
||||||
d->client->sendMessage(message);
|
sendMessage(message);
|
||||||
} else {
|
} else {
|
||||||
watch->m_state = QQmlDebugWatch::Dead;
|
watch->m_state = QQmlDebugWatch::Dead;
|
||||||
}
|
}
|
||||||
|
@ -486,16 +446,16 @@ QQmlDebugPropertyWatch *QQmlEngineDebug::addWatch(const QQmlDebugPropertyReferen
|
||||||
return watch;
|
return watch;
|
||||||
}
|
}
|
||||||
|
|
||||||
QQmlDebugWatch *QQmlEngineDebug::addWatch(const QQmlDebugContextReference &, const QString &, QObject *)
|
QQmlDebugWatch *QQmlEngineDebugClient::addWatch(const QQmlDebugContextReference &, const QString &, QObject *)
|
||||||
{
|
{
|
||||||
qWarning("QQmlEngineDebug::addWatch(): Not implemented");
|
qWarning("QQmlEngineDebug::addWatch(): Not implemented");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
QQmlDebugObjectExpressionWatch *QQmlEngineDebug::addWatch(const QQmlDebugObjectReference &object, const QString &expr, QObject *parent)
|
QQmlDebugObjectExpressionWatch *QQmlEngineDebugClient::addWatch(const QQmlDebugObjectReference &object, const QString &expr, QObject *parent)
|
||||||
{
|
{
|
||||||
QQmlDebugObjectExpressionWatch *watch = new QQmlDebugObjectExpressionWatch(parent);
|
QQmlDebugObjectExpressionWatch *watch = new QQmlDebugObjectExpressionWatch(parent);
|
||||||
if (d->client->state() == QQmlDebugClient::Enabled) {
|
if (state() == QQmlDebugClient::Enabled) {
|
||||||
int queryId = d->getId();
|
int queryId = d->getId();
|
||||||
watch->m_queryId = queryId;
|
watch->m_queryId = queryId;
|
||||||
watch->m_client = this;
|
watch->m_client = this;
|
||||||
|
@ -506,17 +466,17 @@ QQmlDebugObjectExpressionWatch *QQmlEngineDebug::addWatch(const QQmlDebugObjectR
|
||||||
QByteArray message;
|
QByteArray message;
|
||||||
QDataStream ds(&message, QIODevice::WriteOnly);
|
QDataStream ds(&message, QIODevice::WriteOnly);
|
||||||
ds << QByteArray("WATCH_EXPR_OBJECT") << queryId << object.debugId() << expr;
|
ds << QByteArray("WATCH_EXPR_OBJECT") << queryId << object.debugId() << expr;
|
||||||
d->client->sendMessage(message);
|
sendMessage(message);
|
||||||
} else {
|
} else {
|
||||||
watch->m_state = QQmlDebugWatch::Dead;
|
watch->m_state = QQmlDebugWatch::Dead;
|
||||||
}
|
}
|
||||||
return watch;
|
return watch;
|
||||||
}
|
}
|
||||||
|
|
||||||
QQmlDebugWatch *QQmlEngineDebug::addWatch(const QQmlDebugObjectReference &object, QObject *parent)
|
QQmlDebugWatch *QQmlEngineDebugClient::addWatch(const QQmlDebugObjectReference &object, QObject *parent)
|
||||||
{
|
{
|
||||||
QQmlDebugWatch *watch = new QQmlDebugWatch(parent);
|
QQmlDebugWatch *watch = new QQmlDebugWatch(parent);
|
||||||
if (d->client->state() == QQmlDebugClient::Enabled) {
|
if (state() == QQmlDebugClient::Enabled) {
|
||||||
int queryId = d->getId();
|
int queryId = d->getId();
|
||||||
watch->m_queryId = queryId;
|
watch->m_queryId = queryId;
|
||||||
watch->m_client = this;
|
watch->m_client = this;
|
||||||
|
@ -526,7 +486,7 @@ QQmlDebugWatch *QQmlEngineDebug::addWatch(const QQmlDebugObjectReference &object
|
||||||
QByteArray message;
|
QByteArray message;
|
||||||
QDataStream ds(&message, QIODevice::WriteOnly);
|
QDataStream ds(&message, QIODevice::WriteOnly);
|
||||||
ds << QByteArray("WATCH_OBJECT") << queryId << object.debugId();
|
ds << QByteArray("WATCH_OBJECT") << queryId << object.debugId();
|
||||||
d->client->sendMessage(message);
|
sendMessage(message);
|
||||||
} else {
|
} else {
|
||||||
watch->m_state = QQmlDebugWatch::Dead;
|
watch->m_state = QQmlDebugWatch::Dead;
|
||||||
}
|
}
|
||||||
|
@ -534,13 +494,13 @@ QQmlDebugWatch *QQmlEngineDebug::addWatch(const QQmlDebugObjectReference &object
|
||||||
return watch;
|
return watch;
|
||||||
}
|
}
|
||||||
|
|
||||||
QQmlDebugWatch *QQmlEngineDebug::addWatch(const QQmlDebugFileReference &, QObject *)
|
QQmlDebugWatch *QQmlEngineDebugClient::addWatch(const QQmlDebugFileReference &, QObject *)
|
||||||
{
|
{
|
||||||
qWarning("QQmlEngineDebug::addWatch(): Not implemented");
|
qWarning("QQmlEngineDebug::addWatch(): Not implemented");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQmlEngineDebug::removeWatch(QQmlDebugWatch *watch)
|
void QQmlEngineDebugClient::removeWatch(QQmlDebugWatch *watch)
|
||||||
{
|
{
|
||||||
if (!watch || !watch->m_client)
|
if (!watch || !watch->m_client)
|
||||||
return;
|
return;
|
||||||
|
@ -550,18 +510,18 @@ void QQmlEngineDebug::removeWatch(QQmlDebugWatch *watch)
|
||||||
|
|
||||||
d->watched.remove(watch->queryId());
|
d->watched.remove(watch->queryId());
|
||||||
|
|
||||||
if (d->client && d->client->state() == QQmlDebugClient::Enabled) {
|
if (state() == QQmlDebugClient::Enabled) {
|
||||||
QByteArray message;
|
QByteArray message;
|
||||||
QDataStream ds(&message, QIODevice::WriteOnly);
|
QDataStream ds(&message, QIODevice::WriteOnly);
|
||||||
ds << QByteArray("NO_WATCH") << watch->queryId();
|
ds << QByteArray("NO_WATCH") << watch->queryId();
|
||||||
d->client->sendMessage(message);
|
sendMessage(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QQmlDebugEnginesQuery *QQmlEngineDebug::queryAvailableEngines(QObject *parent)
|
QQmlDebugEnginesQuery *QQmlEngineDebugClient::queryAvailableEngines(QObject *parent)
|
||||||
{
|
{
|
||||||
QQmlDebugEnginesQuery *query = new QQmlDebugEnginesQuery(parent);
|
QQmlDebugEnginesQuery *query = new QQmlDebugEnginesQuery(parent);
|
||||||
if (d->client->state() == QQmlDebugClient::Enabled) {
|
if (state() == QQmlDebugClient::Enabled) {
|
||||||
query->m_client = this;
|
query->m_client = this;
|
||||||
int queryId = d->getId();
|
int queryId = d->getId();
|
||||||
query->m_queryId = queryId;
|
query->m_queryId = queryId;
|
||||||
|
@ -570,7 +530,7 @@ QQmlDebugEnginesQuery *QQmlEngineDebug::queryAvailableEngines(QObject *parent)
|
||||||
QByteArray message;
|
QByteArray message;
|
||||||
QDataStream ds(&message, QIODevice::WriteOnly);
|
QDataStream ds(&message, QIODevice::WriteOnly);
|
||||||
ds << QByteArray("LIST_ENGINES") << queryId;
|
ds << QByteArray("LIST_ENGINES") << queryId;
|
||||||
d->client->sendMessage(message);
|
sendMessage(message);
|
||||||
} else {
|
} else {
|
||||||
query->m_state = QQmlDebugQuery::Error;
|
query->m_state = QQmlDebugQuery::Error;
|
||||||
}
|
}
|
||||||
|
@ -578,10 +538,10 @@ QQmlDebugEnginesQuery *QQmlEngineDebug::queryAvailableEngines(QObject *parent)
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
||||||
QQmlDebugRootContextQuery *QQmlEngineDebug::queryRootContexts(const QQmlDebugEngineReference &engine, QObject *parent)
|
QQmlDebugRootContextQuery *QQmlEngineDebugClient::queryRootContexts(const QQmlDebugEngineReference &engine, QObject *parent)
|
||||||
{
|
{
|
||||||
QQmlDebugRootContextQuery *query = new QQmlDebugRootContextQuery(parent);
|
QQmlDebugRootContextQuery *query = new QQmlDebugRootContextQuery(parent);
|
||||||
if (d->client->state() == QQmlDebugClient::Enabled && engine.debugId() != -1) {
|
if (state() == QQmlDebugClient::Enabled && engine.debugId() != -1) {
|
||||||
query->m_client = this;
|
query->m_client = this;
|
||||||
int queryId = d->getId();
|
int queryId = d->getId();
|
||||||
query->m_queryId = queryId;
|
query->m_queryId = queryId;
|
||||||
|
@ -590,7 +550,7 @@ QQmlDebugRootContextQuery *QQmlEngineDebug::queryRootContexts(const QQmlDebugEng
|
||||||
QByteArray message;
|
QByteArray message;
|
||||||
QDataStream ds(&message, QIODevice::WriteOnly);
|
QDataStream ds(&message, QIODevice::WriteOnly);
|
||||||
ds << QByteArray("LIST_OBJECTS") << queryId << engine.debugId();
|
ds << QByteArray("LIST_OBJECTS") << queryId << engine.debugId();
|
||||||
d->client->sendMessage(message);
|
sendMessage(message);
|
||||||
} else {
|
} else {
|
||||||
query->m_state = QQmlDebugQuery::Error;
|
query->m_state = QQmlDebugQuery::Error;
|
||||||
}
|
}
|
||||||
|
@ -598,10 +558,10 @@ QQmlDebugRootContextQuery *QQmlEngineDebug::queryRootContexts(const QQmlDebugEng
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
||||||
QQmlDebugObjectQuery *QQmlEngineDebug::queryObject(const QQmlDebugObjectReference &object, QObject *parent)
|
QQmlDebugObjectQuery *QQmlEngineDebugClient::queryObject(const QQmlDebugObjectReference &object, QObject *parent)
|
||||||
{
|
{
|
||||||
QQmlDebugObjectQuery *query = new QQmlDebugObjectQuery(parent);
|
QQmlDebugObjectQuery *query = new QQmlDebugObjectQuery(parent);
|
||||||
if (d->client->state() == QQmlDebugClient::Enabled && object.debugId() != -1) {
|
if (state() == QQmlDebugClient::Enabled && object.debugId() != -1) {
|
||||||
query->m_client = this;
|
query->m_client = this;
|
||||||
int queryId = d->getId();
|
int queryId = d->getId();
|
||||||
query->m_queryId = queryId;
|
query->m_queryId = queryId;
|
||||||
|
@ -611,7 +571,7 @@ QQmlDebugObjectQuery *QQmlEngineDebug::queryObject(const QQmlDebugObjectReferenc
|
||||||
QDataStream ds(&message, QIODevice::WriteOnly);
|
QDataStream ds(&message, QIODevice::WriteOnly);
|
||||||
ds << QByteArray("FETCH_OBJECT") << queryId << object.debugId()
|
ds << QByteArray("FETCH_OBJECT") << queryId << object.debugId()
|
||||||
<< false << true;
|
<< false << true;
|
||||||
d->client->sendMessage(message);
|
sendMessage(message);
|
||||||
} else {
|
} else {
|
||||||
query->m_state = QQmlDebugQuery::Error;
|
query->m_state = QQmlDebugQuery::Error;
|
||||||
}
|
}
|
||||||
|
@ -619,10 +579,10 @@ QQmlDebugObjectQuery *QQmlEngineDebug::queryObject(const QQmlDebugObjectReferenc
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
||||||
QQmlDebugObjectQuery *QQmlEngineDebug::queryObjectRecursive(const QQmlDebugObjectReference &object, QObject *parent)
|
QQmlDebugObjectQuery *QQmlEngineDebugClient::queryObjectRecursive(const QQmlDebugObjectReference &object, QObject *parent)
|
||||||
{
|
{
|
||||||
QQmlDebugObjectQuery *query = new QQmlDebugObjectQuery(parent);
|
QQmlDebugObjectQuery *query = new QQmlDebugObjectQuery(parent);
|
||||||
if (d->client->state() == QQmlDebugClient::Enabled && object.debugId() != -1) {
|
if (state() == QQmlDebugClient::Enabled && object.debugId() != -1) {
|
||||||
query->m_client = this;
|
query->m_client = this;
|
||||||
int queryId = d->getId();
|
int queryId = d->getId();
|
||||||
query->m_queryId = queryId;
|
query->m_queryId = queryId;
|
||||||
|
@ -632,7 +592,7 @@ QQmlDebugObjectQuery *QQmlEngineDebug::queryObjectRecursive(const QQmlDebugObjec
|
||||||
QDataStream ds(&message, QIODevice::WriteOnly);
|
QDataStream ds(&message, QIODevice::WriteOnly);
|
||||||
ds << QByteArray("FETCH_OBJECT") << queryId << object.debugId()
|
ds << QByteArray("FETCH_OBJECT") << queryId << object.debugId()
|
||||||
<< true << true;
|
<< true << true;
|
||||||
d->client->sendMessage(message);
|
sendMessage(message);
|
||||||
} else {
|
} else {
|
||||||
query->m_state = QQmlDebugQuery::Error;
|
query->m_state = QQmlDebugQuery::Error;
|
||||||
}
|
}
|
||||||
|
@ -640,10 +600,10 @@ QQmlDebugObjectQuery *QQmlEngineDebug::queryObjectRecursive(const QQmlDebugObjec
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
||||||
QQmlDebugExpressionQuery *QQmlEngineDebug::queryExpressionResult(int objectDebugId, const QString &expr, QObject *parent)
|
QQmlDebugExpressionQuery *QQmlEngineDebugClient::queryExpressionResult(int objectDebugId, const QString &expr, QObject *parent)
|
||||||
{
|
{
|
||||||
QQmlDebugExpressionQuery *query = new QQmlDebugExpressionQuery(parent);
|
QQmlDebugExpressionQuery *query = new QQmlDebugExpressionQuery(parent);
|
||||||
if (d->client->state() == QQmlDebugClient::Enabled && objectDebugId != -1) {
|
if (state() == QQmlDebugClient::Enabled && objectDebugId != -1) {
|
||||||
query->m_client = this;
|
query->m_client = this;
|
||||||
query->m_expr = expr;
|
query->m_expr = expr;
|
||||||
int queryId = d->getId();
|
int queryId = d->getId();
|
||||||
|
@ -653,7 +613,7 @@ QQmlDebugExpressionQuery *QQmlEngineDebug::queryExpressionResult(int objectDebug
|
||||||
QByteArray message;
|
QByteArray message;
|
||||||
QDataStream ds(&message, QIODevice::WriteOnly);
|
QDataStream ds(&message, QIODevice::WriteOnly);
|
||||||
ds << QByteArray("EVAL_EXPRESSION") << queryId << objectDebugId << expr;
|
ds << QByteArray("EVAL_EXPRESSION") << queryId << objectDebugId << expr;
|
||||||
d->client->sendMessage(message);
|
sendMessage(message);
|
||||||
} else {
|
} else {
|
||||||
query->m_state = QQmlDebugQuery::Error;
|
query->m_state = QQmlDebugQuery::Error;
|
||||||
}
|
}
|
||||||
|
@ -661,43 +621,43 @@ QQmlDebugExpressionQuery *QQmlEngineDebug::queryExpressionResult(int objectDebug
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QQmlEngineDebug::setBindingForObject(int objectDebugId, const QString &propertyName,
|
bool QQmlEngineDebugClient::setBindingForObject(int objectDebugId, const QString &propertyName,
|
||||||
const QVariant &bindingExpression,
|
const QVariant &bindingExpression,
|
||||||
bool isLiteralValue,
|
bool isLiteralValue,
|
||||||
QString source, int line)
|
QString source, int line)
|
||||||
{
|
{
|
||||||
if (d->client->state() == QQmlDebugClient::Enabled && objectDebugId != -1) {
|
if (state() == QQmlDebugClient::Enabled && objectDebugId != -1) {
|
||||||
QByteArray message;
|
QByteArray message;
|
||||||
QDataStream ds(&message, QIODevice::WriteOnly);
|
QDataStream ds(&message, QIODevice::WriteOnly);
|
||||||
ds << QByteArray("SET_BINDING") << d->getId() << objectDebugId << propertyName << bindingExpression << isLiteralValue << source << line;
|
ds << QByteArray("SET_BINDING") << d->getId() << objectDebugId << propertyName << bindingExpression << isLiteralValue << source << line;
|
||||||
d->client->sendMessage(message);
|
sendMessage(message);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QQmlEngineDebug::resetBindingForObject(int objectDebugId, const QString &propertyName)
|
bool QQmlEngineDebugClient::resetBindingForObject(int objectDebugId, const QString &propertyName)
|
||||||
{
|
{
|
||||||
if (d->client->state() == QQmlDebugClient::Enabled && objectDebugId != -1) {
|
if (state() == QQmlDebugClient::Enabled && objectDebugId != -1) {
|
||||||
QByteArray message;
|
QByteArray message;
|
||||||
QDataStream ds(&message, QIODevice::WriteOnly);
|
QDataStream ds(&message, QIODevice::WriteOnly);
|
||||||
ds << QByteArray("RESET_BINDING") << d->getId() << objectDebugId << propertyName;
|
ds << QByteArray("RESET_BINDING") << d->getId() << objectDebugId << propertyName;
|
||||||
d->client->sendMessage(message);
|
sendMessage(message);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QQmlEngineDebug::setMethodBody(int objectDebugId, const QString &methodName,
|
bool QQmlEngineDebugClient::setMethodBody(int objectDebugId, const QString &methodName,
|
||||||
const QString &methodBody)
|
const QString &methodBody)
|
||||||
{
|
{
|
||||||
if (d->client->state() == QQmlDebugClient::Enabled && objectDebugId != -1) {
|
if (state() == QQmlDebugClient::Enabled && objectDebugId != -1) {
|
||||||
QByteArray message;
|
QByteArray message;
|
||||||
QDataStream ds(&message, QIODevice::WriteOnly);
|
QDataStream ds(&message, QIODevice::WriteOnly);
|
||||||
ds << QByteArray("SET_METHOD_BODY") << d->getId() << objectDebugId << methodName << methodBody;
|
ds << QByteArray("SET_METHOD_BODY") << d->getId() << objectDebugId << methodName << methodBody;
|
||||||
d->client->sendMessage(message);
|
sendMessage(message);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
@ -712,7 +672,7 @@ QQmlDebugWatch::QQmlDebugWatch(QObject *parent)
|
||||||
QQmlDebugWatch::~QQmlDebugWatch()
|
QQmlDebugWatch::~QQmlDebugWatch()
|
||||||
{
|
{
|
||||||
if (m_client && m_queryId != -1)
|
if (m_client && m_queryId != -1)
|
||||||
QQmlEngineDebugPrivate::remove(m_client, this);
|
QQmlEngineDebugClientPrivate::remove(m_client, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
int QQmlDebugWatch::queryId() const
|
int QQmlDebugWatch::queryId() const
|
||||||
|
@ -791,7 +751,7 @@ QQmlDebugEnginesQuery::QQmlDebugEnginesQuery(QObject *parent)
|
||||||
QQmlDebugEnginesQuery::~QQmlDebugEnginesQuery()
|
QQmlDebugEnginesQuery::~QQmlDebugEnginesQuery()
|
||||||
{
|
{
|
||||||
if (m_client && m_queryId != -1)
|
if (m_client && m_queryId != -1)
|
||||||
QQmlEngineDebugPrivate::remove(m_client, this);
|
QQmlEngineDebugClientPrivate::remove(m_client, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QQmlDebugEngineReference> QQmlDebugEnginesQuery::engines() const
|
QList<QQmlDebugEngineReference> QQmlDebugEnginesQuery::engines() const
|
||||||
|
@ -807,7 +767,7 @@ QQmlDebugRootContextQuery::QQmlDebugRootContextQuery(QObject *parent)
|
||||||
QQmlDebugRootContextQuery::~QQmlDebugRootContextQuery()
|
QQmlDebugRootContextQuery::~QQmlDebugRootContextQuery()
|
||||||
{
|
{
|
||||||
if (m_client && m_queryId != -1)
|
if (m_client && m_queryId != -1)
|
||||||
QQmlEngineDebugPrivate::remove(m_client, this);
|
QQmlEngineDebugClientPrivate::remove(m_client, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
QQmlDebugContextReference QQmlDebugRootContextQuery::rootContext() const
|
QQmlDebugContextReference QQmlDebugRootContextQuery::rootContext() const
|
||||||
|
@ -823,7 +783,7 @@ QQmlDebugObjectQuery::QQmlDebugObjectQuery(QObject *parent)
|
||||||
QQmlDebugObjectQuery::~QQmlDebugObjectQuery()
|
QQmlDebugObjectQuery::~QQmlDebugObjectQuery()
|
||||||
{
|
{
|
||||||
if (m_client && m_queryId != -1)
|
if (m_client && m_queryId != -1)
|
||||||
QQmlEngineDebugPrivate::remove(m_client, this);
|
QQmlEngineDebugClientPrivate::remove(m_client, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
QQmlDebugObjectReference QQmlDebugObjectQuery::object() const
|
QQmlDebugObjectReference QQmlDebugObjectQuery::object() const
|
||||||
|
@ -839,7 +799,7 @@ QQmlDebugExpressionQuery::QQmlDebugExpressionQuery(QObject *parent)
|
||||||
QQmlDebugExpressionQuery::~QQmlDebugExpressionQuery()
|
QQmlDebugExpressionQuery::~QQmlDebugExpressionQuery()
|
||||||
{
|
{
|
||||||
if (m_client && m_queryId != -1)
|
if (m_client && m_queryId != -1)
|
||||||
QQmlEngineDebugPrivate::remove(m_client, this);
|
QQmlEngineDebugClientPrivate::remove(m_client, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant QQmlDebugExpressionQuery::expression() const
|
QVariant QQmlDebugExpressionQuery::expression() const
|
|
@ -39,10 +39,11 @@
|
||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef QQMLENGINEDEBUG_H
|
#ifndef QQMLENGINEDEBUGCLIENT_H
|
||||||
#define QQMLENGINEDEBUG_H
|
#define QQMLENGINEDEBUGCLIENT_H
|
||||||
|
|
||||||
|
#include "qqmldebugclient.h"
|
||||||
|
|
||||||
#include <QtCore/qobject.h>
|
|
||||||
#include <QtCore/qurl.h>
|
#include <QtCore/qurl.h>
|
||||||
#include <QtCore/qvariant.h>
|
#include <QtCore/qvariant.h>
|
||||||
|
|
||||||
|
@ -59,17 +60,13 @@ class QQmlDebugContextReference;
|
||||||
class QQmlDebugObjectReference;
|
class QQmlDebugObjectReference;
|
||||||
class QQmlDebugFileReference;
|
class QQmlDebugFileReference;
|
||||||
class QQmlDebugEngineReference;
|
class QQmlDebugEngineReference;
|
||||||
class QQmlEngineDebugPrivate;
|
class QQmlEngineDebugClientPrivate;
|
||||||
class QQmlEngineDebug : public QObject
|
class QQmlEngineDebugClient : public QQmlDebugClient
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
enum State { NotConnected, Unavailable, Enabled };
|
explicit QQmlEngineDebugClient(QQmlDebugConnection *);
|
||||||
|
~QQmlEngineDebugClient();
|
||||||
explicit QQmlEngineDebug(QQmlDebugConnection *, QObject * = 0);
|
|
||||||
~QQmlEngineDebug();
|
|
||||||
|
|
||||||
State state() const;
|
|
||||||
|
|
||||||
QQmlDebugPropertyWatch *addWatch(const QQmlDebugPropertyReference &,
|
QQmlDebugPropertyWatch *addWatch(const QQmlDebugPropertyReference &,
|
||||||
QObject *parent = 0);
|
QObject *parent = 0);
|
||||||
|
@ -100,14 +97,18 @@ public:
|
||||||
bool resetBindingForObject(int objectDebugId, const QString &propertyName);
|
bool resetBindingForObject(int objectDebugId, const QString &propertyName);
|
||||||
bool setMethodBody(int objectDebugId, const QString &methodName, const QString &methodBody);
|
bool setMethodBody(int objectDebugId, const QString &methodName, const QString &methodBody);
|
||||||
|
|
||||||
QQmlEngineDebugPrivate *getPrivate() const { return d; }
|
QQmlEngineDebugClientPrivate *getPrivate() const { return d; }
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void newObjects();
|
void newObjects();
|
||||||
void stateChanged(State state);
|
void newState(State state);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void stateChanged(State status);
|
||||||
|
void messageReceived(const QByteArray &data);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QQmlEngineDebugPrivate *d;
|
QQmlEngineDebugClientPrivate *d;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QQmlDebugWatch : public QObject
|
class QQmlDebugWatch : public QObject
|
||||||
|
@ -132,12 +133,12 @@ Q_SIGNALS:
|
||||||
void valueChanged(const QByteArray &name, const QVariant &value);
|
void valueChanged(const QByteArray &name, const QVariant &value);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class QQmlEngineDebug;
|
friend class QQmlEngineDebugClient;
|
||||||
friend class QQmlEngineDebugPrivate;
|
friend class QQmlEngineDebugClientPrivate;
|
||||||
void setState(State);
|
void setState(State);
|
||||||
State m_state;
|
State m_state;
|
||||||
int m_queryId;
|
int m_queryId;
|
||||||
QQmlEngineDebug *m_client;
|
QQmlEngineDebugClient *m_client;
|
||||||
int m_objectDebugId;
|
int m_objectDebugId;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -150,7 +151,7 @@ public:
|
||||||
QString name() const;
|
QString name() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class QQmlEngineDebug;
|
friend class QQmlEngineDebugClient;
|
||||||
QString m_name;
|
QString m_name;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -163,7 +164,7 @@ public:
|
||||||
QString expression() const;
|
QString expression() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class QQmlEngineDebug;
|
friend class QQmlEngineDebugClient;
|
||||||
QString m_expr;
|
QString m_expr;
|
||||||
int m_debugId;
|
int m_debugId;
|
||||||
};
|
};
|
||||||
|
@ -185,8 +186,8 @@ protected:
|
||||||
QQmlDebugQuery(QObject *);
|
QQmlDebugQuery(QObject *);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class QQmlEngineDebug;
|
friend class QQmlEngineDebugClient;
|
||||||
friend class QQmlEngineDebugPrivate;
|
friend class QQmlEngineDebugClientPrivate;
|
||||||
void setState(State);
|
void setState(State);
|
||||||
State m_state;
|
State m_state;
|
||||||
};
|
};
|
||||||
|
@ -206,7 +207,7 @@ public:
|
||||||
void setColumnNumber(int);
|
void setColumnNumber(int);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class QQmlEngineDebugPrivate;
|
friend class QQmlEngineDebugClientPrivate;
|
||||||
QUrl m_url;
|
QUrl m_url;
|
||||||
int m_lineNumber;
|
int m_lineNumber;
|
||||||
int m_columnNumber;
|
int m_columnNumber;
|
||||||
|
@ -224,7 +225,7 @@ public:
|
||||||
QString name() const;
|
QString name() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class QQmlEngineDebugPrivate;
|
friend class QQmlEngineDebugClientPrivate;
|
||||||
int m_debugId;
|
int m_debugId;
|
||||||
QString m_name;
|
QString m_name;
|
||||||
};
|
};
|
||||||
|
@ -249,7 +250,7 @@ public:
|
||||||
QList<QQmlDebugObjectReference> children() const;
|
QList<QQmlDebugObjectReference> children() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class QQmlEngineDebugPrivate;
|
friend class QQmlEngineDebugClientPrivate;
|
||||||
int m_debugId;
|
int m_debugId;
|
||||||
QString m_class;
|
QString m_class;
|
||||||
QString m_idString;
|
QString m_idString;
|
||||||
|
@ -274,7 +275,7 @@ public:
|
||||||
QList<QQmlDebugContextReference> contexts() const;
|
QList<QQmlDebugContextReference> contexts() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class QQmlEngineDebugPrivate;
|
friend class QQmlEngineDebugClientPrivate;
|
||||||
int m_debugId;
|
int m_debugId;
|
||||||
QString m_name;
|
QString m_name;
|
||||||
QList<QQmlDebugObjectReference> m_objects;
|
QList<QQmlDebugObjectReference> m_objects;
|
||||||
|
@ -296,7 +297,7 @@ public:
|
||||||
bool hasNotifySignal() const;
|
bool hasNotifySignal() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class QQmlEngineDebugPrivate;
|
friend class QQmlEngineDebugClientPrivate;
|
||||||
int m_objectDebugId;
|
int m_objectDebugId;
|
||||||
QString m_name;
|
QString m_name;
|
||||||
QVariant m_value;
|
QVariant m_value;
|
||||||
|
@ -313,10 +314,10 @@ public:
|
||||||
virtual ~QQmlDebugEnginesQuery();
|
virtual ~QQmlDebugEnginesQuery();
|
||||||
QList<QQmlDebugEngineReference> engines() const;
|
QList<QQmlDebugEngineReference> engines() const;
|
||||||
private:
|
private:
|
||||||
friend class QQmlEngineDebug;
|
friend class QQmlEngineDebugClient;
|
||||||
friend class QQmlEngineDebugPrivate;
|
friend class QQmlEngineDebugClientPrivate;
|
||||||
QQmlDebugEnginesQuery(QObject *);
|
QQmlDebugEnginesQuery(QObject *);
|
||||||
QQmlEngineDebug *m_client;
|
QQmlEngineDebugClient *m_client;
|
||||||
int m_queryId;
|
int m_queryId;
|
||||||
QList<QQmlDebugEngineReference> m_engines;
|
QList<QQmlDebugEngineReference> m_engines;
|
||||||
};
|
};
|
||||||
|
@ -328,10 +329,10 @@ public:
|
||||||
virtual ~QQmlDebugRootContextQuery();
|
virtual ~QQmlDebugRootContextQuery();
|
||||||
QQmlDebugContextReference rootContext() const;
|
QQmlDebugContextReference rootContext() const;
|
||||||
private:
|
private:
|
||||||
friend class QQmlEngineDebug;
|
friend class QQmlEngineDebugClient;
|
||||||
friend class QQmlEngineDebugPrivate;
|
friend class QQmlEngineDebugClientPrivate;
|
||||||
QQmlDebugRootContextQuery(QObject *);
|
QQmlDebugRootContextQuery(QObject *);
|
||||||
QQmlEngineDebug *m_client;
|
QQmlEngineDebugClient *m_client;
|
||||||
int m_queryId;
|
int m_queryId;
|
||||||
QQmlDebugContextReference m_context;
|
QQmlDebugContextReference m_context;
|
||||||
};
|
};
|
||||||
|
@ -343,10 +344,10 @@ public:
|
||||||
virtual ~QQmlDebugObjectQuery();
|
virtual ~QQmlDebugObjectQuery();
|
||||||
QQmlDebugObjectReference object() const;
|
QQmlDebugObjectReference object() const;
|
||||||
private:
|
private:
|
||||||
friend class QQmlEngineDebug;
|
friend class QQmlEngineDebugClient;
|
||||||
friend class QQmlEngineDebugPrivate;
|
friend class QQmlEngineDebugClientPrivate;
|
||||||
QQmlDebugObjectQuery(QObject *);
|
QQmlDebugObjectQuery(QObject *);
|
||||||
QQmlEngineDebug *m_client;
|
QQmlEngineDebugClient *m_client;
|
||||||
int m_queryId;
|
int m_queryId;
|
||||||
QQmlDebugObjectReference m_object;
|
QQmlDebugObjectReference m_object;
|
||||||
|
|
||||||
|
@ -360,10 +361,10 @@ public:
|
||||||
QVariant expression() const;
|
QVariant expression() const;
|
||||||
QVariant result() const;
|
QVariant result() const;
|
||||||
private:
|
private:
|
||||||
friend class QQmlEngineDebug;
|
friend class QQmlEngineDebugClient;
|
||||||
friend class QQmlEngineDebugPrivate;
|
friend class QQmlEngineDebugClientPrivate;
|
||||||
QQmlDebugExpressionQuery(QObject *);
|
QQmlDebugExpressionQuery(QObject *);
|
||||||
QQmlEngineDebug *m_client;
|
QQmlEngineDebugClient *m_client;
|
||||||
int m_queryId;
|
int m_queryId;
|
||||||
QVariant m_expr;
|
QVariant m_expr;
|
||||||
QVariant m_result;
|
QVariant m_result;
|
||||||
|
@ -374,4 +375,4 @@ Q_DECLARE_METATYPE(QQmlDebugObjectReference)
|
||||||
Q_DECLARE_METATYPE(QQmlDebugContextReference)
|
Q_DECLARE_METATYPE(QQmlDebugContextReference)
|
||||||
Q_DECLARE_METATYPE(QQmlDebugPropertyReference)
|
Q_DECLARE_METATYPE(QQmlDebugPropertyReference)
|
||||||
|
|
||||||
#endif // QQMLENGINEDEBUG_H
|
#endif // QQMLENGINEDEBUGCLIENT_H
|
|
@ -2,7 +2,11 @@ CONFIG += testcase
|
||||||
TARGET = tst_qqmlenginedebugservice
|
TARGET = tst_qqmlenginedebugservice
|
||||||
macx:CONFIG -= app_bundle
|
macx:CONFIG -= app_bundle
|
||||||
|
|
||||||
SOURCES += tst_qqmlenginedebugservice.cpp
|
HEADERS += \
|
||||||
|
qqmlenginedebugclient.h
|
||||||
|
|
||||||
|
SOURCES += tst_qqmlenginedebugservice.cpp \
|
||||||
|
qqmlenginedebugclient.cpp
|
||||||
|
|
||||||
INCLUDEPATH += ../shared
|
INCLUDEPATH += ../shared
|
||||||
include(../shared/debugutil.pri)
|
include(../shared/debugutil.pri)
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
#include <private/qqmlproperty_p.h>
|
#include <private/qqmlproperty_p.h>
|
||||||
|
|
||||||
#include "debugutil_p.h"
|
#include "debugutil_p.h"
|
||||||
#include "qqmlenginedebug_p.h"
|
#include "qqmlenginedebugclient.h"
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(QQmlDebugWatch::State)
|
Q_DECLARE_METATYPE(QQmlDebugWatch::State)
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ private:
|
||||||
void compareProperties(const QQmlDebugPropertyReference &a, const QQmlDebugPropertyReference &b) const;
|
void compareProperties(const QQmlDebugPropertyReference &a, const QQmlDebugPropertyReference &b) const;
|
||||||
|
|
||||||
QQmlDebugConnection *m_conn;
|
QQmlDebugConnection *m_conn;
|
||||||
QQmlEngineDebug *m_dbg;
|
QQmlEngineDebugClient *m_dbg;
|
||||||
QQmlEngine *m_engine;
|
QQmlEngine *m_engine;
|
||||||
QQuickItem *m_rootItem;
|
QQuickItem *m_rootItem;
|
||||||
|
|
||||||
|
@ -394,13 +394,12 @@ void tst_QQmlEngineDebugService::initTestCase()
|
||||||
bool ok = m_conn->waitForConnected();
|
bool ok = m_conn->waitForConnected();
|
||||||
QVERIFY(ok);
|
QVERIFY(ok);
|
||||||
QTRY_VERIFY(QQmlDebugService::hasDebuggingClient());
|
QTRY_VERIFY(QQmlDebugService::hasDebuggingClient());
|
||||||
m_dbg = new QQmlEngineDebug(m_conn, this);
|
m_dbg = new QQmlEngineDebugClient(m_conn);
|
||||||
QTRY_VERIFY(m_dbg->state() == QQmlEngineDebug::Enabled);
|
QTRY_VERIFY(m_dbg->state() == QQmlEngineDebugClient::Enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QQmlEngineDebugService::cleanupTestCase()
|
void tst_QQmlEngineDebugService::cleanupTestCase()
|
||||||
{
|
{
|
||||||
delete m_dbg;
|
|
||||||
delete m_conn;
|
delete m_conn;
|
||||||
qDeleteAll(m_components);
|
qDeleteAll(m_components);
|
||||||
delete m_engine;
|
delete m_engine;
|
||||||
|
@ -450,7 +449,7 @@ void tst_QQmlEngineDebugService::watch_property()
|
||||||
|
|
||||||
QQmlDebugPropertyWatch *watch;
|
QQmlDebugPropertyWatch *watch;
|
||||||
|
|
||||||
QQmlEngineDebug *unconnected = new QQmlEngineDebug(0);
|
QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(0);
|
||||||
watch = unconnected->addWatch(prop, this);
|
watch = unconnected->addWatch(prop, this);
|
||||||
QCOMPARE(watch->state(), QQmlDebugWatch::Dead);
|
QCOMPARE(watch->state(), QQmlDebugWatch::Dead);
|
||||||
delete watch;
|
delete watch;
|
||||||
|
@ -510,7 +509,7 @@ void tst_QQmlEngineDebugService::watch_object()
|
||||||
|
|
||||||
QQmlDebugWatch *watch;
|
QQmlDebugWatch *watch;
|
||||||
|
|
||||||
QQmlEngineDebug *unconnected = new QQmlEngineDebug(0);
|
QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(0);
|
||||||
watch = unconnected->addWatch(obj, this);
|
watch = unconnected->addWatch(obj, this);
|
||||||
QCOMPARE(watch->state(), QQmlDebugWatch::Dead);
|
QCOMPARE(watch->state(), QQmlDebugWatch::Dead);
|
||||||
delete watch;
|
delete watch;
|
||||||
|
@ -574,7 +573,7 @@ void tst_QQmlEngineDebugService::watch_expression()
|
||||||
|
|
||||||
QQmlDebugObjectExpressionWatch *watch;
|
QQmlDebugObjectExpressionWatch *watch;
|
||||||
|
|
||||||
QQmlEngineDebug *unconnected = new QQmlEngineDebug(0);
|
QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(0);
|
||||||
watch = unconnected->addWatch(obj, expr, this);
|
watch = unconnected->addWatch(obj, expr, this);
|
||||||
QCOMPARE(watch->state(), QQmlDebugWatch::Dead);
|
QCOMPARE(watch->state(), QQmlDebugWatch::Dead);
|
||||||
delete watch;
|
delete watch;
|
||||||
|
@ -653,7 +652,7 @@ void tst_QQmlEngineDebugService::queryAvailableEngines()
|
||||||
{
|
{
|
||||||
QQmlDebugEnginesQuery *q_engines;
|
QQmlDebugEnginesQuery *q_engines;
|
||||||
|
|
||||||
QQmlEngineDebug *unconnected = new QQmlEngineDebug(0);
|
QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(0);
|
||||||
q_engines = unconnected->queryAvailableEngines(0);
|
q_engines = unconnected->queryAvailableEngines(0);
|
||||||
QCOMPARE(q_engines->state(), QQmlDebugQuery::Error);
|
QCOMPARE(q_engines->state(), QQmlDebugQuery::Error);
|
||||||
delete q_engines;
|
delete q_engines;
|
||||||
|
@ -681,7 +680,7 @@ void tst_QQmlEngineDebugService::queryAvailableEngines()
|
||||||
delete m_dbg;
|
delete m_dbg;
|
||||||
QCOMPARE(q_engines->state(), QQmlDebugQuery::Error);
|
QCOMPARE(q_engines->state(), QQmlDebugQuery::Error);
|
||||||
delete q_engines;
|
delete q_engines;
|
||||||
m_dbg = new QQmlEngineDebug(m_conn, this);
|
m_dbg = new QQmlEngineDebugClient(m_conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QQmlEngineDebugService::queryRootContexts()
|
void tst_QQmlEngineDebugService::queryRootContexts()
|
||||||
|
@ -693,7 +692,7 @@ void tst_QQmlEngineDebugService::queryRootContexts()
|
||||||
|
|
||||||
QQmlDebugRootContextQuery *q_context;
|
QQmlDebugRootContextQuery *q_context;
|
||||||
|
|
||||||
QQmlEngineDebug *unconnected = new QQmlEngineDebug(0);
|
QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(0);
|
||||||
q_context = unconnected->queryRootContexts(engineId, this);
|
q_context = unconnected->queryRootContexts(engineId, this);
|
||||||
QCOMPARE(q_context->state(), QQmlDebugQuery::Error);
|
QCOMPARE(q_context->state(), QQmlDebugQuery::Error);
|
||||||
delete q_context;
|
delete q_context;
|
||||||
|
@ -724,7 +723,7 @@ void tst_QQmlEngineDebugService::queryRootContexts()
|
||||||
delete m_dbg;
|
delete m_dbg;
|
||||||
QCOMPARE(q_context->state(), QQmlDebugQuery::Error);
|
QCOMPARE(q_context->state(), QQmlDebugQuery::Error);
|
||||||
delete q_context;
|
delete q_context;
|
||||||
m_dbg = new QQmlEngineDebug(m_conn, this);
|
m_dbg = new QQmlEngineDebugClient(m_conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QQmlEngineDebugService::queryObject()
|
void tst_QQmlEngineDebugService::queryObject()
|
||||||
|
@ -740,7 +739,7 @@ void tst_QQmlEngineDebugService::queryObject()
|
||||||
|
|
||||||
QQmlDebugObjectQuery *q_obj = 0;
|
QQmlDebugObjectQuery *q_obj = 0;
|
||||||
|
|
||||||
QQmlEngineDebug *unconnected = new QQmlEngineDebug(0);
|
QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(0);
|
||||||
q_obj = recursive ? unconnected->queryObjectRecursive(rootObject, this) : unconnected->queryObject(rootObject, this);
|
q_obj = recursive ? unconnected->queryObjectRecursive(rootObject, this) : unconnected->queryObject(rootObject, this);
|
||||||
QCOMPARE(q_obj->state(), QQmlDebugQuery::Error);
|
QCOMPARE(q_obj->state(), QQmlDebugQuery::Error);
|
||||||
delete q_obj;
|
delete q_obj;
|
||||||
|
@ -763,7 +762,7 @@ void tst_QQmlEngineDebugService::queryObject()
|
||||||
delete m_dbg;
|
delete m_dbg;
|
||||||
QCOMPARE(q_obj->state(), QQmlDebugQuery::Error);
|
QCOMPARE(q_obj->state(), QQmlDebugQuery::Error);
|
||||||
delete q_obj;
|
delete q_obj;
|
||||||
m_dbg = new QQmlEngineDebug(m_conn, this);
|
m_dbg = new QQmlEngineDebugClient(m_conn);
|
||||||
|
|
||||||
// check source as defined in main()
|
// check source as defined in main()
|
||||||
QQmlDebugFileReference source = obj.source();
|
QQmlDebugFileReference source = obj.source();
|
||||||
|
@ -821,7 +820,7 @@ void tst_QQmlEngineDebugService::queryExpressionResult()
|
||||||
|
|
||||||
QQmlDebugExpressionQuery *q_expr;
|
QQmlDebugExpressionQuery *q_expr;
|
||||||
|
|
||||||
QQmlEngineDebug *unconnected = new QQmlEngineDebug(0);
|
QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(0);
|
||||||
q_expr = unconnected->queryExpressionResult(objectId, expr, this);
|
q_expr = unconnected->queryExpressionResult(objectId, expr, this);
|
||||||
QCOMPARE(q_expr->state(), QQmlDebugQuery::Error);
|
QCOMPARE(q_expr->state(), QQmlDebugQuery::Error);
|
||||||
delete q_expr;
|
delete q_expr;
|
||||||
|
@ -845,7 +844,7 @@ void tst_QQmlEngineDebugService::queryExpressionResult()
|
||||||
delete m_dbg;
|
delete m_dbg;
|
||||||
QCOMPARE(q_expr->state(), QQmlDebugQuery::Error);
|
QCOMPARE(q_expr->state(), QQmlDebugQuery::Error);
|
||||||
delete q_expr;
|
delete q_expr;
|
||||||
m_dbg = new QQmlEngineDebug(m_conn, this);
|
m_dbg = new QQmlEngineDebugClient(m_conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QQmlEngineDebugService::queryExpressionResult_data()
|
void tst_QQmlEngineDebugService::queryExpressionResult_data()
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
HEADERS += $$PWD/debugutil_p.h \
|
HEADERS += $$PWD/debugutil_p.h \
|
||||||
$$PWD/qqmldebugclient.h \
|
$$PWD/qqmldebugclient.h \
|
||||||
$$PWD/qqmlenginedebug_p.h \
|
|
||||||
$$PWD/../../../../../src/plugins/qmltooling/shared/qpacketprotocol.h
|
$$PWD/../../../../../src/plugins/qmltooling/shared/qpacketprotocol.h
|
||||||
|
|
||||||
SOURCES += $$PWD/debugutil.cpp \
|
SOURCES += $$PWD/debugutil.cpp \
|
||||||
$$PWD/qqmldebugclient.cpp \
|
$$PWD/qqmldebugclient.cpp \
|
||||||
$$PWD/qqmlenginedebug.cpp \
|
|
||||||
$$PWD/../../../../../src/plugins/qmltooling/shared/qpacketprotocol.cpp
|
$$PWD/../../../../../src/plugins/qmltooling/shared/qpacketprotocol.cpp
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue