1 /****************************************************************************
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
7 ** This file is part of the QtDeclarative module of the Qt Toolkit.
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** GNU Lesser General Public License Usage
11 ** This file may be used under the terms of the GNU Lesser General Public
12 ** License version 2.1 as published by the Free Software Foundation and
13 ** appearing in the file LICENSE.LGPL included in the packaging of this
14 ** file. Please review the following information to ensure the GNU Lesser
15 ** General Public License version 2.1 requirements will be met:
16 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
18 ** In addition, as a special exception, Nokia gives you certain additional
19 ** rights. These rights are described in the Nokia Qt LGPL Exception
20 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
22 ** GNU General Public License Usage
23 ** Alternatively, this file may be used under the terms of the GNU General
24 ** Public License version 3.0 as published by the Free Software Foundation
25 ** and appearing in the file LICENSE.GPL included in the packaging of this
26 ** file. Please review the following information to ensure the GNU General
27 ** Public License version 3.0 requirements will be met:
28 ** http://www.gnu.org/copyleft/gpl.html.
31 ** Alternatively, this file may be used in accordance with the terms and
32 ** conditions contained in a signed written agreement between you and Nokia.
40 ****************************************************************************/
42 #include "qdeclarativeenginedebug_p.h"
44 #include "qdeclarativedebugclient_p.h"
46 #include "qdeclarativeenginedebugservice_p.h"
48 #include <private/qobject_p.h>
52 class QDeclarativeEngineDebugClient : public QDeclarativeDebugClient
55 QDeclarativeEngineDebugClient(QDeclarativeDebugConnection *client, QDeclarativeEngineDebugPrivate *p);
58 virtual void statusChanged(Status status);
59 virtual void messageReceived(const QByteArray &);
62 QDeclarativeEngineDebugPrivate *priv;
63 friend class QDeclarativeEngineDebugPrivate;
66 class QDeclarativeEngineDebugPrivate : public QObjectPrivate
68 Q_DECLARE_PUBLIC(QDeclarativeEngineDebug)
70 QDeclarativeEngineDebugPrivate(QDeclarativeDebugConnection *);
71 ~QDeclarativeEngineDebugPrivate();
73 void statusChanged(QDeclarativeEngineDebug::Status status);
74 void message(const QByteArray &);
76 QDeclarativeEngineDebugClient *client;
80 void decode(QDataStream &, QDeclarativeDebugContextReference &);
81 void decode(QDataStream &, QDeclarativeDebugObjectReference &, bool simple);
83 static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugEnginesQuery *);
84 static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugRootContextQuery *);
85 static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugObjectQuery *);
86 static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugExpressionQuery *);
87 static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugWatch *);
89 QHash<int, QDeclarativeDebugEnginesQuery *> enginesQuery;
90 QHash<int, QDeclarativeDebugRootContextQuery *> rootContextQuery;
91 QHash<int, QDeclarativeDebugObjectQuery *> objectQuery;
92 QHash<int, QDeclarativeDebugExpressionQuery *> expressionQuery;
94 QHash<int, QDeclarativeDebugWatch *> watched;
97 QDeclarativeEngineDebugClient::QDeclarativeEngineDebugClient(QDeclarativeDebugConnection *client,
98 QDeclarativeEngineDebugPrivate *p)
99 : QDeclarativeDebugClient(QLatin1String("QDeclarativeEngine"), client), priv(p)
103 void QDeclarativeEngineDebugClient::statusChanged(Status status)
106 priv->statusChanged(static_cast<QDeclarativeEngineDebug::Status>(status));
109 void QDeclarativeEngineDebugClient::messageReceived(const QByteArray &data)
115 QDeclarativeEngineDebugPrivate::QDeclarativeEngineDebugPrivate(QDeclarativeDebugConnection *c)
116 : client(new QDeclarativeEngineDebugClient(c, this)), nextId(0)
120 QDeclarativeEngineDebugPrivate::~QDeclarativeEngineDebugPrivate()
126 QHash<int, QDeclarativeDebugEnginesQuery*>::iterator enginesIter = enginesQuery.begin();
127 for (; enginesIter != enginesQuery.end(); ++enginesIter) {
128 enginesIter.value()->m_client = 0;
129 if (enginesIter.value()->state() == QDeclarativeDebugQuery::Waiting)
130 enginesIter.value()->setState(QDeclarativeDebugQuery::Error);
133 QHash<int, QDeclarativeDebugRootContextQuery*>::iterator rootContextIter = rootContextQuery.begin();
134 for (; rootContextIter != rootContextQuery.end(); ++rootContextIter) {
135 rootContextIter.value()->m_client = 0;
136 if (rootContextIter.value()->state() == QDeclarativeDebugQuery::Waiting)
137 rootContextIter.value()->setState(QDeclarativeDebugQuery::Error);
140 QHash<int, QDeclarativeDebugObjectQuery*>::iterator objectIter = objectQuery.begin();
141 for (; objectIter != objectQuery.end(); ++objectIter) {
142 objectIter.value()->m_client = 0;
143 if (objectIter.value()->state() == QDeclarativeDebugQuery::Waiting)
144 objectIter.value()->setState(QDeclarativeDebugQuery::Error);
147 QHash<int, QDeclarativeDebugExpressionQuery*>::iterator exprIter = expressionQuery.begin();
148 for (; exprIter != expressionQuery.end(); ++exprIter) {
149 exprIter.value()->m_client = 0;
150 if (exprIter.value()->state() == QDeclarativeDebugQuery::Waiting)
151 exprIter.value()->setState(QDeclarativeDebugQuery::Error);
154 QHash<int, QDeclarativeDebugWatch*>::iterator watchIter = watched.begin();
155 for (; watchIter != watched.end(); ++watchIter) {
156 watchIter.value()->m_client = 0;
157 watchIter.value()->setState(QDeclarativeDebugWatch::Dead);
161 int QDeclarativeEngineDebugPrivate::getId()
166 void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, QDeclarativeDebugEnginesQuery *q)
169 QDeclarativeEngineDebugPrivate *p = (QDeclarativeEngineDebugPrivate *)QObjectPrivate::get(c);
170 p->enginesQuery.remove(q->m_queryId);
174 void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c,
175 QDeclarativeDebugRootContextQuery *q)
178 QDeclarativeEngineDebugPrivate *p = (QDeclarativeEngineDebugPrivate *)QObjectPrivate::get(c);
179 p->rootContextQuery.remove(q->m_queryId);
183 void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, QDeclarativeDebugObjectQuery *q)
186 QDeclarativeEngineDebugPrivate *p = (QDeclarativeEngineDebugPrivate *)QObjectPrivate::get(c);
187 p->objectQuery.remove(q->m_queryId);
191 void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, QDeclarativeDebugExpressionQuery *q)
194 QDeclarativeEngineDebugPrivate *p = (QDeclarativeEngineDebugPrivate *)QObjectPrivate::get(c);
195 p->expressionQuery.remove(q->m_queryId);
199 void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, QDeclarativeDebugWatch *w)
202 QDeclarativeEngineDebugPrivate *p = (QDeclarativeEngineDebugPrivate *)QObjectPrivate::get(c);
203 p->watched.remove(w->m_queryId);
207 void QDeclarativeEngineDebugPrivate::decode(QDataStream &ds, QDeclarativeDebugObjectReference &o,
210 QDeclarativeEngineDebugService::QDeclarativeObjectData data;
212 o.m_debugId = data.objectId;
213 o.m_class = data.objectType;
214 o.m_idString = data.idString;
215 o.m_name = data.objectName;
216 o.m_source.m_url = data.url;
217 o.m_source.m_lineNumber = data.lineNumber;
218 o.m_source.m_columnNumber = data.columnNumber;
219 o.m_contextDebugId = data.contextId;
226 ds >> childCount >> recur;
228 for (int ii = 0; ii < childCount; ++ii) {
229 o.m_children.append(QDeclarativeDebugObjectReference());
230 decode(ds, o.m_children.last(), !recur);
236 for (int ii = 0; ii < propCount; ++ii) {
237 QDeclarativeEngineDebugService::QDeclarativeObjectProperty data;
239 QDeclarativeDebugPropertyReference prop;
240 prop.m_objectDebugId = o.m_debugId;
241 prop.m_name = data.name;
242 prop.m_binding = data.binding;
243 prop.m_hasNotifySignal = data.hasNotifySignal;
244 prop.m_valueTypeName = data.valueTypeName;
246 case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Basic:
247 case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::List:
248 case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::SignalProperty:
250 prop.m_value = data.value;
253 case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Object:
255 QDeclarativeDebugObjectReference obj;
256 obj.m_debugId = prop.m_value.toInt();
257 prop.m_value = QVariant::fromValue(obj);
260 case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Unknown:
263 o.m_properties << prop;
267 void QDeclarativeEngineDebugPrivate::decode(QDataStream &ds, QDeclarativeDebugContextReference &c)
269 ds >> c.m_name >> c.m_debugId;
274 for (int ii = 0; ii < contextCount; ++ii) {
275 c.m_contexts.append(QDeclarativeDebugContextReference());
276 decode(ds, c.m_contexts.last());
282 for (int ii = 0; ii < objectCount; ++ii) {
283 QDeclarativeDebugObjectReference obj;
284 decode(ds, obj, true);
286 obj.m_contextDebugId = c.m_debugId;
291 void QDeclarativeEngineDebugPrivate::statusChanged(QDeclarativeEngineDebug::Status status)
293 emit q_func()->statusChanged(status);
296 void QDeclarativeEngineDebugPrivate::message(const QByteArray &data)
298 QDataStream ds(data);
303 //qDebug() << "QDeclarativeEngineDebugPrivate::message()" << type;
305 if (type == "LIST_ENGINES_R") {
309 QDeclarativeDebugEnginesQuery *query = enginesQuery.value(queryId);
312 enginesQuery.remove(queryId);
317 for (int ii = 0; ii < count; ++ii) {
318 QDeclarativeDebugEngineReference ref;
321 query->m_engines << ref;
325 query->setState(QDeclarativeDebugQuery::Completed);
326 } else if (type == "LIST_OBJECTS_R") {
330 QDeclarativeDebugRootContextQuery *query = rootContextQuery.value(queryId);
333 rootContextQuery.remove(queryId);
336 decode(ds, query->m_context);
339 query->setState(QDeclarativeDebugQuery::Completed);
340 } else if (type == "FETCH_OBJECT_R") {
344 QDeclarativeDebugObjectQuery *query = objectQuery.value(queryId);
347 objectQuery.remove(queryId);
350 decode(ds, query->m_object, false);
353 query->setState(QDeclarativeDebugQuery::Completed);
354 } else if (type == "EVAL_EXPRESSION_R") {
357 ds >> queryId >> result;
359 QDeclarativeDebugExpressionQuery *query = expressionQuery.value(queryId);
362 expressionQuery.remove(queryId);
364 query->m_result = result;
366 query->setState(QDeclarativeDebugQuery::Completed);
367 } else if (type == "WATCH_PROPERTY_R") {
372 QDeclarativeDebugWatch *watch = watched.value(queryId);
376 watch->setState(ok ? QDeclarativeDebugWatch::Active : QDeclarativeDebugWatch::Inactive);
377 } else if (type == "WATCH_OBJECT_R") {
382 QDeclarativeDebugWatch *watch = watched.value(queryId);
386 watch->setState(ok ? QDeclarativeDebugWatch::Active : QDeclarativeDebugWatch::Inactive);
387 } else if (type == "WATCH_EXPR_OBJECT_R") {
392 QDeclarativeDebugWatch *watch = watched.value(queryId);
396 watch->setState(ok ? QDeclarativeDebugWatch::Active : QDeclarativeDebugWatch::Inactive);
397 } else if (type == "UPDATE_WATCH") {
402 ds >> queryId >> debugId >> name >> value;
404 QDeclarativeDebugWatch *watch = watched.value(queryId, 0);
407 emit watch->valueChanged(name, value);
408 } else if (type == "OBJECT_CREATED") {
409 emit q_func()->newObjects();
413 QDeclarativeEngineDebug::QDeclarativeEngineDebug(QDeclarativeDebugConnection *client, QObject *parent)
414 : QObject(*(new QDeclarativeEngineDebugPrivate(client)), parent)
418 QDeclarativeEngineDebug::~QDeclarativeEngineDebug()
422 QDeclarativeEngineDebug::Status QDeclarativeEngineDebug::status() const
424 Q_D(const QDeclarativeEngineDebug);
426 return static_cast<QDeclarativeEngineDebug::Status>(d->client->status());
429 QDeclarativeDebugPropertyWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugPropertyReference &property, QObject *parent)
431 Q_D(QDeclarativeEngineDebug);
433 QDeclarativeDebugPropertyWatch *watch = new QDeclarativeDebugPropertyWatch(parent);
434 if (d->client->status() == QDeclarativeDebugClient::Enabled) {
435 int queryId = d->getId();
436 watch->m_queryId = queryId;
437 watch->m_client = this;
438 watch->m_objectDebugId = property.objectDebugId();
439 watch->m_name = property.name();
440 d->watched.insert(queryId, watch);
443 QDataStream ds(&message, QIODevice::WriteOnly);
444 ds << QByteArray("WATCH_PROPERTY") << queryId << property.objectDebugId() << property.name().toUtf8();
445 d->client->sendMessage(message);
447 watch->m_state = QDeclarativeDebugWatch::Dead;
453 QDeclarativeDebugWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugContextReference &, const QString &, QObject *)
455 qWarning("QDeclarativeEngineDebug::addWatch(): Not implemented");
459 QDeclarativeDebugObjectExpressionWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugObjectReference &object, const QString &expr, QObject *parent)
461 Q_D(QDeclarativeEngineDebug);
462 QDeclarativeDebugObjectExpressionWatch *watch = new QDeclarativeDebugObjectExpressionWatch(parent);
463 if (d->client->status() == QDeclarativeDebugClient::Enabled) {
464 int queryId = d->getId();
465 watch->m_queryId = queryId;
466 watch->m_client = this;
467 watch->m_objectDebugId = object.debugId();
468 watch->m_expr = expr;
469 d->watched.insert(queryId, watch);
472 QDataStream ds(&message, QIODevice::WriteOnly);
473 ds << QByteArray("WATCH_EXPR_OBJECT") << queryId << object.debugId() << expr;
474 d->client->sendMessage(message);
476 watch->m_state = QDeclarativeDebugWatch::Dead;
481 QDeclarativeDebugWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugObjectReference &object, QObject *parent)
483 Q_D(QDeclarativeEngineDebug);
485 QDeclarativeDebugWatch *watch = new QDeclarativeDebugWatch(parent);
486 if (d->client->status() == QDeclarativeDebugClient::Enabled) {
487 int queryId = d->getId();
488 watch->m_queryId = queryId;
489 watch->m_client = this;
490 watch->m_objectDebugId = object.debugId();
491 d->watched.insert(queryId, watch);
494 QDataStream ds(&message, QIODevice::WriteOnly);
495 ds << QByteArray("WATCH_OBJECT") << queryId << object.debugId();
496 d->client->sendMessage(message);
498 watch->m_state = QDeclarativeDebugWatch::Dead;
504 QDeclarativeDebugWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugFileReference &, QObject *)
506 qWarning("QDeclarativeEngineDebug::addWatch(): Not implemented");
510 void QDeclarativeEngineDebug::removeWatch(QDeclarativeDebugWatch *watch)
512 Q_D(QDeclarativeEngineDebug);
514 if (!watch || !watch->m_client)
518 watch->setState(QDeclarativeDebugWatch::Inactive);
520 d->watched.remove(watch->queryId());
522 if (d->client && d->client->status() == QDeclarativeDebugClient::Enabled) {
524 QDataStream ds(&message, QIODevice::WriteOnly);
525 ds << QByteArray("NO_WATCH") << watch->queryId();
526 d->client->sendMessage(message);
530 QDeclarativeDebugEnginesQuery *QDeclarativeEngineDebug::queryAvailableEngines(QObject *parent)
532 Q_D(QDeclarativeEngineDebug);
534 QDeclarativeDebugEnginesQuery *query = new QDeclarativeDebugEnginesQuery(parent);
535 if (d->client->status() == QDeclarativeDebugClient::Enabled) {
536 query->m_client = this;
537 int queryId = d->getId();
538 query->m_queryId = queryId;
539 d->enginesQuery.insert(queryId, query);
542 QDataStream ds(&message, QIODevice::WriteOnly);
543 ds << QByteArray("LIST_ENGINES") << queryId;
544 d->client->sendMessage(message);
546 query->m_state = QDeclarativeDebugQuery::Error;
552 QDeclarativeDebugRootContextQuery *QDeclarativeEngineDebug::queryRootContexts(const QDeclarativeDebugEngineReference &engine, QObject *parent)
554 Q_D(QDeclarativeEngineDebug);
556 QDeclarativeDebugRootContextQuery *query = new QDeclarativeDebugRootContextQuery(parent);
557 if (d->client->status() == QDeclarativeDebugClient::Enabled && engine.debugId() != -1) {
558 query->m_client = this;
559 int queryId = d->getId();
560 query->m_queryId = queryId;
561 d->rootContextQuery.insert(queryId, query);
564 QDataStream ds(&message, QIODevice::WriteOnly);
565 ds << QByteArray("LIST_OBJECTS") << queryId << engine.debugId();
566 d->client->sendMessage(message);
568 query->m_state = QDeclarativeDebugQuery::Error;
574 QDeclarativeDebugObjectQuery *QDeclarativeEngineDebug::queryObject(const QDeclarativeDebugObjectReference &object, QObject *parent)
576 Q_D(QDeclarativeEngineDebug);
578 QDeclarativeDebugObjectQuery *query = new QDeclarativeDebugObjectQuery(parent);
579 if (d->client->status() == QDeclarativeDebugClient::Enabled && object.debugId() != -1) {
580 query->m_client = this;
581 int queryId = d->getId();
582 query->m_queryId = queryId;
583 d->objectQuery.insert(queryId, query);
586 QDataStream ds(&message, QIODevice::WriteOnly);
587 ds << QByteArray("FETCH_OBJECT") << queryId << object.debugId()
589 d->client->sendMessage(message);
591 query->m_state = QDeclarativeDebugQuery::Error;
597 QDeclarativeDebugObjectQuery *QDeclarativeEngineDebug::queryObjectRecursive(const QDeclarativeDebugObjectReference &object, QObject *parent)
599 Q_D(QDeclarativeEngineDebug);
601 QDeclarativeDebugObjectQuery *query = new QDeclarativeDebugObjectQuery(parent);
602 if (d->client->status() == QDeclarativeDebugClient::Enabled && object.debugId() != -1) {
603 query->m_client = this;
604 int queryId = d->getId();
605 query->m_queryId = queryId;
606 d->objectQuery.insert(queryId, query);
609 QDataStream ds(&message, QIODevice::WriteOnly);
610 ds << QByteArray("FETCH_OBJECT") << queryId << object.debugId()
612 d->client->sendMessage(message);
614 query->m_state = QDeclarativeDebugQuery::Error;
620 QDeclarativeDebugExpressionQuery *QDeclarativeEngineDebug::queryExpressionResult(int objectDebugId, const QString &expr, QObject *parent)
622 Q_D(QDeclarativeEngineDebug);
624 QDeclarativeDebugExpressionQuery *query = new QDeclarativeDebugExpressionQuery(parent);
625 if (d->client->status() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) {
626 query->m_client = this;
627 query->m_expr = expr;
628 int queryId = d->getId();
629 query->m_queryId = queryId;
630 d->expressionQuery.insert(queryId, query);
633 QDataStream ds(&message, QIODevice::WriteOnly);
634 ds << QByteArray("EVAL_EXPRESSION") << queryId << objectDebugId << expr;
635 d->client->sendMessage(message);
637 query->m_state = QDeclarativeDebugQuery::Error;
643 bool QDeclarativeEngineDebug::setBindingForObject(int objectDebugId, const QString &propertyName,
644 const QVariant &bindingExpression,
646 QString source, int line)
648 Q_D(QDeclarativeEngineDebug);
650 if (d->client->status() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) {
652 QDataStream ds(&message, QIODevice::WriteOnly);
653 ds << QByteArray("SET_BINDING") << objectDebugId << propertyName << bindingExpression << isLiteralValue << source << line;
654 d->client->sendMessage(message);
661 bool QDeclarativeEngineDebug::resetBindingForObject(int objectDebugId, const QString &propertyName)
663 Q_D(QDeclarativeEngineDebug);
665 if (d->client->status() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) {
667 QDataStream ds(&message, QIODevice::WriteOnly);
668 ds << QByteArray("RESET_BINDING") << objectDebugId << propertyName;
669 d->client->sendMessage(message);
676 bool QDeclarativeEngineDebug::setMethodBody(int objectDebugId, const QString &methodName,
677 const QString &methodBody)
679 Q_D(QDeclarativeEngineDebug);
681 if (d->client->status() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) {
683 QDataStream ds(&message, QIODevice::WriteOnly);
684 ds << QByteArray("SET_METHOD_BODY") << objectDebugId << methodName << methodBody;
685 d->client->sendMessage(message);
692 QDeclarativeDebugWatch::QDeclarativeDebugWatch(QObject *parent)
693 : QObject(parent), m_state(Waiting), m_queryId(-1), m_client(0), m_objectDebugId(-1)
697 QDeclarativeDebugWatch::~QDeclarativeDebugWatch()
699 if (m_client && m_queryId != -1)
700 QDeclarativeEngineDebugPrivate::remove(m_client, this);
703 int QDeclarativeDebugWatch::queryId() const
708 int QDeclarativeDebugWatch::objectDebugId() const
710 return m_objectDebugId;
713 QDeclarativeDebugWatch::State QDeclarativeDebugWatch::state() const
718 void QDeclarativeDebugWatch::setState(State s)
723 emit stateChanged(m_state);
726 QDeclarativeDebugPropertyWatch::QDeclarativeDebugPropertyWatch(QObject *parent)
727 : QDeclarativeDebugWatch(parent)
731 QString QDeclarativeDebugPropertyWatch::name() const
737 QDeclarativeDebugObjectExpressionWatch::QDeclarativeDebugObjectExpressionWatch(QObject *parent)
738 : QDeclarativeDebugWatch(parent)
742 QString QDeclarativeDebugObjectExpressionWatch::expression() const
748 QDeclarativeDebugQuery::QDeclarativeDebugQuery(QObject *parent)
749 : QObject(parent), m_state(Waiting)
753 QDeclarativeDebugQuery::State QDeclarativeDebugQuery::state() const
758 bool QDeclarativeDebugQuery::isWaiting() const
760 return m_state == Waiting;
763 void QDeclarativeDebugQuery::setState(State s)
768 emit stateChanged(m_state);
771 QDeclarativeDebugEnginesQuery::QDeclarativeDebugEnginesQuery(QObject *parent)
772 : QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1)
776 QDeclarativeDebugEnginesQuery::~QDeclarativeDebugEnginesQuery()
778 if (m_client && m_queryId != -1)
779 QDeclarativeEngineDebugPrivate::remove(m_client, this);
782 QList<QDeclarativeDebugEngineReference> QDeclarativeDebugEnginesQuery::engines() const
787 QDeclarativeDebugRootContextQuery::QDeclarativeDebugRootContextQuery(QObject *parent)
788 : QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1)
792 QDeclarativeDebugRootContextQuery::~QDeclarativeDebugRootContextQuery()
794 if (m_client && m_queryId != -1)
795 QDeclarativeEngineDebugPrivate::remove(m_client, this);
798 QDeclarativeDebugContextReference QDeclarativeDebugRootContextQuery::rootContext() const
803 QDeclarativeDebugObjectQuery::QDeclarativeDebugObjectQuery(QObject *parent)
804 : QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1)
808 QDeclarativeDebugObjectQuery::~QDeclarativeDebugObjectQuery()
810 if (m_client && m_queryId != -1)
811 QDeclarativeEngineDebugPrivate::remove(m_client, this);
814 QDeclarativeDebugObjectReference QDeclarativeDebugObjectQuery::object() const
819 QDeclarativeDebugExpressionQuery::QDeclarativeDebugExpressionQuery(QObject *parent)
820 : QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1)
824 QDeclarativeDebugExpressionQuery::~QDeclarativeDebugExpressionQuery()
826 if (m_client && m_queryId != -1)
827 QDeclarativeEngineDebugPrivate::remove(m_client, this);
830 QVariant QDeclarativeDebugExpressionQuery::expression() const
835 QVariant QDeclarativeDebugExpressionQuery::result() const
840 QDeclarativeDebugEngineReference::QDeclarativeDebugEngineReference()
845 QDeclarativeDebugEngineReference::QDeclarativeDebugEngineReference(int debugId)
850 QDeclarativeDebugEngineReference::QDeclarativeDebugEngineReference(const QDeclarativeDebugEngineReference &o)
851 : m_debugId(o.m_debugId), m_name(o.m_name)
855 QDeclarativeDebugEngineReference &
856 QDeclarativeDebugEngineReference::operator=(const QDeclarativeDebugEngineReference &o)
858 m_debugId = o.m_debugId; m_name = o.m_name;
862 int QDeclarativeDebugEngineReference::debugId() const
867 QString QDeclarativeDebugEngineReference::name() const
872 QDeclarativeDebugObjectReference::QDeclarativeDebugObjectReference()
873 : m_debugId(-1), m_contextDebugId(-1)
877 QDeclarativeDebugObjectReference::QDeclarativeDebugObjectReference(int debugId)
878 : m_debugId(debugId), m_contextDebugId(-1)
882 QDeclarativeDebugObjectReference::QDeclarativeDebugObjectReference(const QDeclarativeDebugObjectReference &o)
883 : m_debugId(o.m_debugId), m_class(o.m_class), m_idString(o.m_idString),
884 m_name(o.m_name), m_source(o.m_source), m_contextDebugId(o.m_contextDebugId),
885 m_properties(o.m_properties), m_children(o.m_children)
889 QDeclarativeDebugObjectReference &
890 QDeclarativeDebugObjectReference::operator=(const QDeclarativeDebugObjectReference &o)
892 m_debugId = o.m_debugId; m_class = o.m_class; m_idString = o.m_idString;
893 m_name = o.m_name; m_source = o.m_source; m_contextDebugId = o.m_contextDebugId;
894 m_properties = o.m_properties; m_children = o.m_children;
898 int QDeclarativeDebugObjectReference::debugId() const
903 QString QDeclarativeDebugObjectReference::className() const
908 QString QDeclarativeDebugObjectReference::idString() const
913 QString QDeclarativeDebugObjectReference::name() const
918 QDeclarativeDebugFileReference QDeclarativeDebugObjectReference::source() const
923 int QDeclarativeDebugObjectReference::contextDebugId() const
925 return m_contextDebugId;
928 QList<QDeclarativeDebugPropertyReference> QDeclarativeDebugObjectReference::properties() const
933 QList<QDeclarativeDebugObjectReference> QDeclarativeDebugObjectReference::children() const
938 QDeclarativeDebugContextReference::QDeclarativeDebugContextReference()
943 QDeclarativeDebugContextReference::QDeclarativeDebugContextReference(const QDeclarativeDebugContextReference &o)
944 : m_debugId(o.m_debugId), m_name(o.m_name), m_objects(o.m_objects), m_contexts(o.m_contexts)
948 QDeclarativeDebugContextReference &QDeclarativeDebugContextReference::operator=(const QDeclarativeDebugContextReference &o)
950 m_debugId = o.m_debugId; m_name = o.m_name; m_objects = o.m_objects;
951 m_contexts = o.m_contexts;
955 int QDeclarativeDebugContextReference::debugId() const
960 QString QDeclarativeDebugContextReference::name() const
965 QList<QDeclarativeDebugObjectReference> QDeclarativeDebugContextReference::objects() const
970 QList<QDeclarativeDebugContextReference> QDeclarativeDebugContextReference::contexts() const
975 QDeclarativeDebugFileReference::QDeclarativeDebugFileReference()
976 : m_lineNumber(-1), m_columnNumber(-1)
980 QDeclarativeDebugFileReference::QDeclarativeDebugFileReference(const QDeclarativeDebugFileReference &o)
981 : m_url(o.m_url), m_lineNumber(o.m_lineNumber), m_columnNumber(o.m_columnNumber)
985 QDeclarativeDebugFileReference &QDeclarativeDebugFileReference::operator=(const QDeclarativeDebugFileReference &o)
987 m_url = o.m_url; m_lineNumber = o.m_lineNumber; m_columnNumber = o.m_columnNumber;
991 QUrl QDeclarativeDebugFileReference::url() const
996 void QDeclarativeDebugFileReference::setUrl(const QUrl &u)
1001 int QDeclarativeDebugFileReference::lineNumber() const
1003 return m_lineNumber;
1006 void QDeclarativeDebugFileReference::setLineNumber(int l)
1011 int QDeclarativeDebugFileReference::columnNumber() const
1013 return m_columnNumber;
1016 void QDeclarativeDebugFileReference::setColumnNumber(int c)
1021 QDeclarativeDebugPropertyReference::QDeclarativeDebugPropertyReference()
1022 : m_objectDebugId(-1), m_hasNotifySignal(false)
1026 QDeclarativeDebugPropertyReference::QDeclarativeDebugPropertyReference(const QDeclarativeDebugPropertyReference &o)
1027 : m_objectDebugId(o.m_objectDebugId), m_name(o.m_name), m_value(o.m_value),
1028 m_valueTypeName(o.m_valueTypeName), m_binding(o.m_binding),
1029 m_hasNotifySignal(o.m_hasNotifySignal)
1033 QDeclarativeDebugPropertyReference &QDeclarativeDebugPropertyReference::operator=(const QDeclarativeDebugPropertyReference &o)
1035 m_objectDebugId = o.m_objectDebugId; m_name = o.m_name; m_value = o.m_value;
1036 m_valueTypeName = o.m_valueTypeName; m_binding = o.m_binding;
1037 m_hasNotifySignal = o.m_hasNotifySignal;
1041 int QDeclarativeDebugPropertyReference::objectDebugId() const
1043 return m_objectDebugId;
1046 QString QDeclarativeDebugPropertyReference::name() const
1051 QString QDeclarativeDebugPropertyReference::valueTypeName() const
1053 return m_valueTypeName;
1056 QVariant QDeclarativeDebugPropertyReference::value() const
1061 QString QDeclarativeDebugPropertyReference::binding() const
1066 bool QDeclarativeDebugPropertyReference::hasNotifySignal() const
1068 return m_hasNotifySignal;