1 /****************************************************************************
3 ** Copyright (C) 2011 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 ** No Commercial Usage
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
16 ** GNU Lesser General Public License Usage
17 ** Alternatively, this file may be used under the terms of the GNU Lesser
18 ** General Public License version 2.1 as published by the Free Software
19 ** Foundation and appearing in the file LICENSE.LGPL included in the
20 ** packaging of this file. Please review the following information to
21 ** ensure the GNU Lesser General Public License version 2.1 requirements
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 ** In addition, as a special exception, Nokia gives you certain additional
25 ** rights. These rights are described in the Nokia Qt LGPL Exception
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
40 ****************************************************************************/
42 #include "qdeclarativedebug_p.h"
44 #include "qdeclarativedebugclient_p.h"
46 namespace QmlJsDebugClient {
48 class QDeclarativeEngineDebugClient : public QDeclarativeDebugClient
51 QDeclarativeEngineDebugClient(QDeclarativeDebugConnection *client, QDeclarativeEngineDebugPrivate *p);
52 ~QDeclarativeEngineDebugClient();
55 virtual void statusChanged(Status status);
56 virtual void messageReceived(const QByteArray &);
59 QDeclarativeEngineDebugPrivate *priv;
60 friend class QDeclarativeEngineDebugPrivate;
63 class QDeclarativeEngineDebugPrivate
65 // Q_DECLARE_PUBLIC(QDeclarativeEngineDebug)
67 QDeclarativeEngineDebugPrivate(QDeclarativeEngineDebug *, QDeclarativeDebugConnection *);
68 ~QDeclarativeEngineDebugPrivate();
70 void statusChanged(QDeclarativeEngineDebug::Status status);
71 void message(const QByteArray &);
73 QDeclarativeEngineDebugClient *client;
74 QDeclarativeEngineDebug *q_ptr;
78 void decode(QDataStream &, QDeclarativeDebugContextReference &);
79 void decode(QDataStream &, QDeclarativeDebugObjectReference &, bool simple);
81 static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugEnginesQuery *);
82 static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugRootContextQuery *);
83 static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugObjectQuery *);
84 static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugExpressionQuery *);
85 static void remove(QDeclarativeEngineDebug *, QDeclarativeDebugWatch *);
87 QHash<int, QDeclarativeDebugEnginesQuery *> enginesQuery;
88 QHash<int, QDeclarativeDebugRootContextQuery *> rootContextQuery;
89 QHash<int, QDeclarativeDebugObjectQuery *> objectQuery;
90 QHash<int, QDeclarativeDebugExpressionQuery *> expressionQuery;
92 QHash<int, QDeclarativeDebugWatch *> watched;
95 QDeclarativeEngineDebugClient::QDeclarativeEngineDebugClient(QDeclarativeDebugConnection *client,
96 QDeclarativeEngineDebugPrivate *p)
97 : QDeclarativeDebugClient(QLatin1String("QDeclarativeEngine"), client), priv(p)
101 QDeclarativeEngineDebugClient::~QDeclarativeEngineDebugClient()
105 void QDeclarativeEngineDebugClient::statusChanged(Status status)
108 priv->statusChanged(static_cast<QDeclarativeEngineDebug::Status>(status));
111 void QDeclarativeEngineDebugClient::messageReceived(const QByteArray &data)
117 QDeclarativeEngineDebugPrivate::QDeclarativeEngineDebugPrivate(QDeclarativeEngineDebug *q, QDeclarativeDebugConnection *c)
118 : client(new QDeclarativeEngineDebugClient(c, this)), q_ptr(q), nextId(0)
122 QDeclarativeEngineDebugPrivate::~QDeclarativeEngineDebugPrivate()
128 QHash<int, QDeclarativeDebugEnginesQuery*>::iterator enginesIter = enginesQuery.begin();
129 for (; enginesIter != enginesQuery.end(); ++enginesIter) {
130 enginesIter.value()->m_client = 0;
131 if (enginesIter.value()->state() == QDeclarativeDebugQuery::Waiting)
132 enginesIter.value()->setState(QDeclarativeDebugQuery::Error);
135 QHash<int, QDeclarativeDebugRootContextQuery*>::iterator rootContextIter = rootContextQuery.begin();
136 for (; rootContextIter != rootContextQuery.end(); ++rootContextIter) {
137 rootContextIter.value()->m_client = 0;
138 if (rootContextIter.value()->state() == QDeclarativeDebugQuery::Waiting)
139 rootContextIter.value()->setState(QDeclarativeDebugQuery::Error);
142 QHash<int, QDeclarativeDebugObjectQuery*>::iterator objectIter = objectQuery.begin();
143 for (; objectIter != objectQuery.end(); ++objectIter) {
144 objectIter.value()->m_client = 0;
145 if (objectIter.value()->state() == QDeclarativeDebugQuery::Waiting)
146 objectIter.value()->setState(QDeclarativeDebugQuery::Error);
149 QHash<int, QDeclarativeDebugExpressionQuery*>::iterator exprIter = expressionQuery.begin();
150 for (; exprIter != expressionQuery.end(); ++exprIter) {
151 exprIter.value()->m_client = 0;
152 if (exprIter.value()->state() == QDeclarativeDebugQuery::Waiting)
153 exprIter.value()->setState(QDeclarativeDebugQuery::Error);
156 QHash<int, QDeclarativeDebugWatch*>::iterator watchIter = watched.begin();
157 for (; watchIter != watched.end(); ++watchIter) {
158 watchIter.value()->m_client = 0;
159 watchIter.value()->setState(QDeclarativeDebugWatch::Dead);
163 int QDeclarativeEngineDebugPrivate::getId()
168 void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, QDeclarativeDebugEnginesQuery *q)
171 QDeclarativeEngineDebugPrivate *p = c->d_func();
172 p->enginesQuery.remove(q->m_queryId);
176 void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c,
177 QDeclarativeDebugRootContextQuery *q)
180 QDeclarativeEngineDebugPrivate *p = c->d_func();
181 p->rootContextQuery.remove(q->m_queryId);
185 void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, QDeclarativeDebugWatch *w)
188 QDeclarativeEngineDebugPrivate *p = c->d_func();
189 p->watched.remove(w->m_queryId);
193 // from qdeclarativeenginedebug_p.h
194 struct QDeclarativeObjectData {
205 QDataStream &operator>>(QDataStream &ds, QDeclarativeObjectData &data)
207 ds >> data.url >> data.lineNumber >> data.columnNumber >> data.idString
208 >> data.objectName >> data.objectType >> data.objectId >> data.contextId;
212 struct QDeclarativeObjectProperty {
213 enum Type { Unknown, Basic, Object, List, SignalProperty };
217 QString valueTypeName;
219 bool hasNotifySignal;
222 QDataStream &operator>>(QDataStream &ds, QDeclarativeObjectProperty &data)
225 ds >> type >> data.name >> data.value >> data.valueTypeName
226 >> data.binding >> data.hasNotifySignal;
227 data.type = (QDeclarativeObjectProperty::Type)type;
231 void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, QDeclarativeDebugObjectQuery *q)
234 QDeclarativeEngineDebugPrivate *p = c->d_func();
235 p->objectQuery.remove(q->m_queryId);
239 void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, QDeclarativeDebugExpressionQuery *q)
242 QDeclarativeEngineDebugPrivate *p = c->d_func();
243 p->expressionQuery.remove(q->m_queryId);
247 void QDeclarativeEngineDebugPrivate::decode(QDataStream &ds, QDeclarativeDebugObjectReference &o,
250 QDeclarativeObjectData data;
252 o.m_debugId = data.objectId;
253 o.m_class = data.objectType;
254 o.m_idString = data.idString;
255 o.m_name = data.objectName;
256 o.m_source.m_url = data.url;
257 o.m_source.m_lineNumber = data.lineNumber;
258 o.m_source.m_columnNumber = data.columnNumber;
259 o.m_contextDebugId = data.contextId;
266 ds >> childCount >> recur;
268 for (int ii = 0; ii < childCount; ++ii) {
269 o.m_children.append(QDeclarativeDebugObjectReference());
270 decode(ds, o.m_children.last(), !recur);
276 for (int ii = 0; ii < propCount; ++ii) {
277 QDeclarativeObjectProperty data;
279 QDeclarativeDebugPropertyReference prop;
280 prop.m_objectDebugId = o.m_debugId;
281 prop.m_name = data.name;
282 prop.m_binding = data.binding;
283 prop.m_hasNotifySignal = data.hasNotifySignal;
284 prop.m_valueTypeName = data.valueTypeName;
286 case QDeclarativeObjectProperty::Basic:
287 case QDeclarativeObjectProperty::List:
288 case QDeclarativeObjectProperty::SignalProperty:
290 prop.m_value = data.value;
293 case QDeclarativeObjectProperty::Object:
295 QDeclarativeDebugObjectReference obj;
296 obj.m_debugId = prop.m_value.toInt();
297 prop.m_value = qVariantFromValue(obj);
300 case QDeclarativeObjectProperty::Unknown:
303 o.m_properties << prop;
307 void QDeclarativeEngineDebugPrivate::decode(QDataStream &ds, QDeclarativeDebugContextReference &c)
309 ds >> c.m_name >> c.m_debugId;
314 for (int ii = 0; ii < contextCount; ++ii) {
315 c.m_contexts.append(QDeclarativeDebugContextReference());
316 decode(ds, c.m_contexts.last());
322 for (int ii = 0; ii < objectCount; ++ii) {
323 QDeclarativeDebugObjectReference obj;
324 decode(ds, obj, true);
326 obj.m_contextDebugId = c.m_debugId;
331 void QDeclarativeEngineDebugPrivate::statusChanged(QDeclarativeEngineDebug::Status status)
333 emit q_ptr->statusChanged(status);
336 void QDeclarativeEngineDebugPrivate::message(const QByteArray &data)
338 QDataStream ds(data);
343 //qDebug() << "QDeclarativeEngineDebugPrivate::message()" << type;
345 if (type == "LIST_ENGINES_R") {
349 QDeclarativeDebugEnginesQuery *query = enginesQuery.value(queryId);
352 enginesQuery.remove(queryId);
357 for (int ii = 0; ii < count; ++ii) {
358 QDeclarativeDebugEngineReference ref;
361 query->m_engines << ref;
365 query->setState(QDeclarativeDebugQuery::Completed);
366 } else if (type == "LIST_OBJECTS_R") {
370 QDeclarativeDebugRootContextQuery *query = rootContextQuery.value(queryId);
373 rootContextQuery.remove(queryId);
376 decode(ds, query->m_context);
379 query->setState(QDeclarativeDebugQuery::Completed);
380 } else if (type == "FETCH_OBJECT_R") {
384 QDeclarativeDebugObjectQuery *query = objectQuery.value(queryId);
387 objectQuery.remove(queryId);
390 decode(ds, query->m_object, false);
393 query->setState(QDeclarativeDebugQuery::Completed);
394 } else if (type == "EVAL_EXPRESSION_R") {
397 ds >> queryId >> result;
399 QDeclarativeDebugExpressionQuery *query = expressionQuery.value(queryId);
402 expressionQuery.remove(queryId);
404 query->m_result = result;
406 query->setState(QDeclarativeDebugQuery::Completed);
407 } else if (type == "WATCH_PROPERTY_R") {
412 QDeclarativeDebugWatch *watch = watched.value(queryId);
416 watch->setState(ok ? QDeclarativeDebugWatch::Active : QDeclarativeDebugWatch::Inactive);
417 } else if (type == "WATCH_OBJECT_R") {
422 QDeclarativeDebugWatch *watch = watched.value(queryId);
426 watch->setState(ok ? QDeclarativeDebugWatch::Active : QDeclarativeDebugWatch::Inactive);
427 } else if (type == "WATCH_EXPR_OBJECT_R") {
432 QDeclarativeDebugWatch *watch = watched.value(queryId);
436 watch->setState(ok ? QDeclarativeDebugWatch::Active : QDeclarativeDebugWatch::Inactive);
437 } else if (type == "UPDATE_WATCH") {
442 ds >> queryId >> debugId >> name >> value;
444 QDeclarativeDebugWatch *watch = watched.value(queryId, 0);
447 emit watch->valueChanged(name, value);
448 } else if (type == "OBJECT_CREATED") {
449 emit q_ptr->newObjects();
453 QDeclarativeEngineDebug::QDeclarativeEngineDebug(QDeclarativeDebugConnection *client, QObject *parent)
454 : QObject(parent), d_ptr(new QDeclarativeEngineDebugPrivate(this, client))
458 QDeclarativeEngineDebug::~QDeclarativeEngineDebug() { }
460 QDeclarativeEngineDebug::Status QDeclarativeEngineDebug::status() const
462 Q_D(const QDeclarativeEngineDebug);
464 return static_cast<QDeclarativeEngineDebug::Status>(d->client->status());
467 QDeclarativeDebugPropertyWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugPropertyReference &property, QObject *parent)
469 Q_D(QDeclarativeEngineDebug);
471 QDeclarativeDebugPropertyWatch *watch = new QDeclarativeDebugPropertyWatch(parent);
472 if (d->client->status() == QDeclarativeDebugClient::Enabled) {
473 int queryId = d->getId();
474 watch->m_queryId = queryId;
475 watch->m_client = this;
476 watch->m_objectDebugId = property.objectDebugId();
477 watch->m_name = property.name();
478 d->watched.insert(queryId, watch);
481 QDataStream ds(&message, QIODevice::WriteOnly);
482 ds << QByteArray("WATCH_PROPERTY") << queryId << property.objectDebugId() << property.name().toUtf8();
483 d->client->sendMessage(message);
485 watch->m_state = QDeclarativeDebugWatch::Dead;
491 QDeclarativeDebugWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugContextReference &, const QString &, QObject *)
493 qWarning("QDeclarativeEngineDebug::addWatch(): Not implemented");
497 QDeclarativeDebugObjectExpressionWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugObjectReference &object, const QString &expr, QObject *parent)
499 Q_D(QDeclarativeEngineDebug);
500 QDeclarativeDebugObjectExpressionWatch *watch = new QDeclarativeDebugObjectExpressionWatch(parent);
501 if (d->client->status() == QDeclarativeDebugClient::Enabled) {
502 int queryId = d->getId();
503 watch->m_queryId = queryId;
504 watch->m_client = this;
505 watch->m_objectDebugId = object.debugId();
506 watch->m_expr = expr;
507 d->watched.insert(queryId, watch);
510 QDataStream ds(&message, QIODevice::WriteOnly);
511 ds << QByteArray("WATCH_EXPR_OBJECT") << queryId << object.debugId() << expr;
512 d->client->sendMessage(message);
514 watch->m_state = QDeclarativeDebugWatch::Dead;
519 QDeclarativeDebugWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugObjectReference &object, QObject *parent)
521 Q_D(QDeclarativeEngineDebug);
523 QDeclarativeDebugWatch *watch = new QDeclarativeDebugWatch(parent);
524 if (d->client->status() == QDeclarativeDebugClient::Enabled) {
525 int queryId = d->getId();
526 watch->m_queryId = queryId;
527 watch->m_client = this;
528 watch->m_objectDebugId = object.debugId();
529 d->watched.insert(queryId, watch);
532 QDataStream ds(&message, QIODevice::WriteOnly);
533 ds << QByteArray("WATCH_OBJECT") << queryId << object.debugId();
534 d->client->sendMessage(message);
536 watch->m_state = QDeclarativeDebugWatch::Dead;
542 QDeclarativeDebugWatch *QDeclarativeEngineDebug::addWatch(const QDeclarativeDebugFileReference &, QObject *)
544 qWarning("QDeclarativeEngineDebug::addWatch(): Not implemented");
548 void QDeclarativeEngineDebug::removeWatch(QDeclarativeDebugWatch *watch)
550 Q_D(QDeclarativeEngineDebug);
552 if (!watch || !watch->m_client)
556 watch->setState(QDeclarativeDebugWatch::Inactive);
558 d->watched.remove(watch->queryId());
560 if (d->client && d->client->status() == QDeclarativeDebugClient::Enabled) {
562 QDataStream ds(&message, QIODevice::WriteOnly);
563 ds << QByteArray("NO_WATCH") << watch->queryId();
564 d->client->sendMessage(message);
568 QDeclarativeDebugEnginesQuery *QDeclarativeEngineDebug::queryAvailableEngines(QObject *parent)
570 Q_D(QDeclarativeEngineDebug);
572 QDeclarativeDebugEnginesQuery *query = new QDeclarativeDebugEnginesQuery(parent);
573 if (d->client->status() == QDeclarativeDebugClient::Enabled) {
574 query->m_client = this;
575 int queryId = d->getId();
576 query->m_queryId = queryId;
577 d->enginesQuery.insert(queryId, query);
580 QDataStream ds(&message, QIODevice::WriteOnly);
581 ds << QByteArray("LIST_ENGINES") << queryId;
582 d->client->sendMessage(message);
584 query->m_state = QDeclarativeDebugQuery::Error;
590 QDeclarativeDebugRootContextQuery *QDeclarativeEngineDebug::queryRootContexts(const QDeclarativeDebugEngineReference &engine, QObject *parent)
592 Q_D(QDeclarativeEngineDebug);
594 QDeclarativeDebugRootContextQuery *query = new QDeclarativeDebugRootContextQuery(parent);
595 if (d->client->status() == QDeclarativeDebugClient::Enabled && engine.debugId() != -1) {
596 query->m_client = this;
597 int queryId = d->getId();
598 query->m_queryId = queryId;
599 d->rootContextQuery.insert(queryId, query);
602 QDataStream ds(&message, QIODevice::WriteOnly);
603 ds << QByteArray("LIST_OBJECTS") << queryId << engine.debugId();
604 d->client->sendMessage(message);
606 query->m_state = QDeclarativeDebugQuery::Error;
612 QDeclarativeDebugObjectQuery *QDeclarativeEngineDebug::queryObject(const QDeclarativeDebugObjectReference &object, QObject *parent)
614 Q_D(QDeclarativeEngineDebug);
616 QDeclarativeDebugObjectQuery *query = new QDeclarativeDebugObjectQuery(parent);
617 if (d->client->status() == QDeclarativeDebugClient::Enabled && object.debugId() != -1) {
618 query->m_client = this;
619 int queryId = d->getId();
620 query->m_queryId = queryId;
621 d->objectQuery.insert(queryId, query);
624 QDataStream ds(&message, QIODevice::WriteOnly);
625 ds << QByteArray("FETCH_OBJECT") << queryId << object.debugId()
627 d->client->sendMessage(message);
629 query->m_state = QDeclarativeDebugQuery::Error;
635 QDeclarativeDebugObjectQuery *QDeclarativeEngineDebug::queryObjectRecursive(const QDeclarativeDebugObjectReference &object, QObject *parent)
637 Q_D(QDeclarativeEngineDebug);
639 QDeclarativeDebugObjectQuery *query = new QDeclarativeDebugObjectQuery(parent);
640 if (d->client->status() == QDeclarativeDebugClient::Enabled && object.debugId() != -1) {
641 query->m_client = this;
642 int queryId = d->getId();
643 query->m_queryId = queryId;
644 d->objectQuery.insert(queryId, query);
647 QDataStream ds(&message, QIODevice::WriteOnly);
648 ds << QByteArray("FETCH_OBJECT") << queryId << object.debugId()
650 d->client->sendMessage(message);
652 query->m_state = QDeclarativeDebugQuery::Error;
658 QDeclarativeDebugExpressionQuery *QDeclarativeEngineDebug::queryExpressionResult(int objectDebugId, const QString &expr, QObject *parent)
660 Q_D(QDeclarativeEngineDebug);
662 QDeclarativeDebugExpressionQuery *query = new QDeclarativeDebugExpressionQuery(parent);
663 if (d->client->status() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) {
664 query->m_client = this;
665 query->m_expr = expr;
666 int queryId = d->getId();
667 query->m_queryId = queryId;
668 d->expressionQuery.insert(queryId, query);
671 QDataStream ds(&message, QIODevice::WriteOnly);
672 ds << QByteArray("EVAL_EXPRESSION") << queryId << objectDebugId << expr;
673 d->client->sendMessage(message);
675 query->m_state = QDeclarativeDebugQuery::Error;
681 bool QDeclarativeEngineDebug::setBindingForObject(int objectDebugId, const QString &propertyName,
682 const QVariant &bindingExpression,
685 Q_D(QDeclarativeEngineDebug);
687 if (d->client->status() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) {
689 QDataStream ds(&message, QIODevice::WriteOnly);
690 ds << QByteArray("SET_BINDING") << objectDebugId << propertyName << bindingExpression << isLiteralValue;
691 d->client->sendMessage(message);
698 bool QDeclarativeEngineDebug::resetBindingForObject(int objectDebugId, const QString &propertyName)
700 Q_D(QDeclarativeEngineDebug);
702 if (d->client->status() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) {
704 QDataStream ds(&message, QIODevice::WriteOnly);
705 ds << QByteArray("RESET_BINDING") << objectDebugId << propertyName;
706 d->client->sendMessage(message);
713 bool QDeclarativeEngineDebug::setMethodBody(int objectDebugId, const QString &methodName,
714 const QString &methodBody)
716 Q_D(QDeclarativeEngineDebug);
718 if (d->client->status() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) {
720 QDataStream ds(&message, QIODevice::WriteOnly);
721 ds << QByteArray("SET_METHOD_BODY") << objectDebugId << methodName << methodBody;
722 d->client->sendMessage(message);
729 QDeclarativeDebugWatch::QDeclarativeDebugWatch(QObject *parent)
730 : QObject(parent), m_state(Waiting), m_queryId(-1), m_client(0), m_objectDebugId(-1)
734 QDeclarativeDebugWatch::~QDeclarativeDebugWatch()
736 if (m_client && m_queryId != -1)
737 QDeclarativeEngineDebugPrivate::remove(m_client, this);
740 int QDeclarativeDebugWatch::queryId() const
745 int QDeclarativeDebugWatch::objectDebugId() const
747 return m_objectDebugId;
750 QDeclarativeDebugWatch::State QDeclarativeDebugWatch::state() const
755 void QDeclarativeDebugWatch::setState(State s)
760 emit stateChanged(m_state);
763 QDeclarativeDebugPropertyWatch::QDeclarativeDebugPropertyWatch(QObject *parent)
764 : QDeclarativeDebugWatch(parent)
768 QString QDeclarativeDebugPropertyWatch::name() const
774 QDeclarativeDebugObjectExpressionWatch::QDeclarativeDebugObjectExpressionWatch(QObject *parent)
775 : QDeclarativeDebugWatch(parent)
779 QString QDeclarativeDebugObjectExpressionWatch::expression() const
785 QDeclarativeDebugQuery::QDeclarativeDebugQuery(QObject *parent)
786 : QObject(parent), m_state(Waiting)
790 QDeclarativeDebugQuery::State QDeclarativeDebugQuery::state() const
795 bool QDeclarativeDebugQuery::isWaiting() const
797 return m_state == Waiting;
800 void QDeclarativeDebugQuery::setState(State s)
805 emit stateChanged(m_state);
808 QDeclarativeDebugEnginesQuery::QDeclarativeDebugEnginesQuery(QObject *parent)
809 : QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1)
813 QDeclarativeDebugEnginesQuery::~QDeclarativeDebugEnginesQuery()
815 if (m_client && m_queryId != -1)
816 QDeclarativeEngineDebugPrivate::remove(m_client, this);
819 QList<QDeclarativeDebugEngineReference> QDeclarativeDebugEnginesQuery::engines() const
824 QDeclarativeDebugRootContextQuery::QDeclarativeDebugRootContextQuery(QObject *parent)
825 : QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1)
829 QDeclarativeDebugRootContextQuery::~QDeclarativeDebugRootContextQuery()
831 if (m_client && m_queryId != -1)
832 QDeclarativeEngineDebugPrivate::remove(m_client, this);
835 QDeclarativeDebugContextReference QDeclarativeDebugRootContextQuery::rootContext() const
840 QDeclarativeDebugObjectQuery::QDeclarativeDebugObjectQuery(QObject *parent)
841 : QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1)
845 QDeclarativeDebugObjectQuery::~QDeclarativeDebugObjectQuery()
847 if (m_client && m_queryId != -1)
848 QDeclarativeEngineDebugPrivate::remove(m_client, this);
851 QDeclarativeDebugObjectReference QDeclarativeDebugObjectQuery::object() const
856 QDeclarativeDebugExpressionQuery::QDeclarativeDebugExpressionQuery(QObject *parent)
857 : QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1)
861 QDeclarativeDebugExpressionQuery::~QDeclarativeDebugExpressionQuery()
863 if (m_client && m_queryId != -1)
864 QDeclarativeEngineDebugPrivate::remove(m_client, this);
867 QVariant QDeclarativeDebugExpressionQuery::expression() const
872 QVariant QDeclarativeDebugExpressionQuery::result() const
877 QDeclarativeDebugEngineReference::QDeclarativeDebugEngineReference()
882 QDeclarativeDebugEngineReference::QDeclarativeDebugEngineReference(int debugId)
887 QDeclarativeDebugEngineReference::QDeclarativeDebugEngineReference(const QDeclarativeDebugEngineReference &o)
888 : m_debugId(o.m_debugId), m_name(o.m_name)
892 QDeclarativeDebugEngineReference &
893 QDeclarativeDebugEngineReference::operator=(const QDeclarativeDebugEngineReference &o)
895 m_debugId = o.m_debugId; m_name = o.m_name;
899 int QDeclarativeDebugEngineReference::debugId() const
904 QString QDeclarativeDebugEngineReference::name() const
909 QDeclarativeDebugObjectReference::QDeclarativeDebugObjectReference()
910 : m_debugId(-1), m_contextDebugId(-1)
914 QDeclarativeDebugObjectReference::QDeclarativeDebugObjectReference(int debugId)
915 : m_debugId(debugId), m_contextDebugId(-1)
919 QDeclarativeDebugObjectReference::QDeclarativeDebugObjectReference(const QDeclarativeDebugObjectReference &o)
920 : m_debugId(o.m_debugId), m_class(o.m_class), m_idString(o.m_idString),
921 m_name(o.m_name), m_source(o.m_source), m_contextDebugId(o.m_contextDebugId),
922 m_properties(o.m_properties), m_children(o.m_children)
926 QDeclarativeDebugObjectReference &
927 QDeclarativeDebugObjectReference::operator=(const QDeclarativeDebugObjectReference &o)
929 m_debugId = o.m_debugId; m_class = o.m_class; m_idString = o.m_idString;
930 m_name = o.m_name; m_source = o.m_source; m_contextDebugId = o.m_contextDebugId;
931 m_properties = o.m_properties; m_children = o.m_children;
935 int QDeclarativeDebugObjectReference::debugId() const
940 QString QDeclarativeDebugObjectReference::className() const
945 QString QDeclarativeDebugObjectReference::idString() const
950 QString QDeclarativeDebugObjectReference::name() const
955 QDeclarativeDebugFileReference QDeclarativeDebugObjectReference::source() const
960 int QDeclarativeDebugObjectReference::contextDebugId() const
962 return m_contextDebugId;
965 QList<QDeclarativeDebugPropertyReference> QDeclarativeDebugObjectReference::properties() const
970 QList<QDeclarativeDebugObjectReference> QDeclarativeDebugObjectReference::children() const
975 QDeclarativeDebugContextReference::QDeclarativeDebugContextReference()
980 QDeclarativeDebugContextReference::QDeclarativeDebugContextReference(const QDeclarativeDebugContextReference &o)
981 : m_debugId(o.m_debugId), m_name(o.m_name), m_objects(o.m_objects), m_contexts(o.m_contexts)
985 QDeclarativeDebugContextReference &QDeclarativeDebugContextReference::operator=(const QDeclarativeDebugContextReference &o)
987 m_debugId = o.m_debugId; m_name = o.m_name; m_objects = o.m_objects;
988 m_contexts = o.m_contexts;
992 int QDeclarativeDebugContextReference::debugId() const
997 QString QDeclarativeDebugContextReference::name() const
1002 QList<QDeclarativeDebugObjectReference> QDeclarativeDebugContextReference::objects() const
1007 QList<QDeclarativeDebugContextReference> QDeclarativeDebugContextReference::contexts() const
1012 QDeclarativeDebugFileReference::QDeclarativeDebugFileReference()
1013 : m_lineNumber(-1), m_columnNumber(-1)
1017 QDeclarativeDebugFileReference::QDeclarativeDebugFileReference(const QDeclarativeDebugFileReference &o)
1018 : m_url(o.m_url), m_lineNumber(o.m_lineNumber), m_columnNumber(o.m_columnNumber)
1022 QDeclarativeDebugFileReference &QDeclarativeDebugFileReference::operator=(const QDeclarativeDebugFileReference &o)
1024 m_url = o.m_url; m_lineNumber = o.m_lineNumber; m_columnNumber = o.m_columnNumber;
1028 QUrl QDeclarativeDebugFileReference::url() const
1033 void QDeclarativeDebugFileReference::setUrl(const QUrl &u)
1038 int QDeclarativeDebugFileReference::lineNumber() const
1040 return m_lineNumber;
1043 void QDeclarativeDebugFileReference::setLineNumber(int l)
1048 int QDeclarativeDebugFileReference::columnNumber() const
1050 return m_columnNumber;
1053 void QDeclarativeDebugFileReference::setColumnNumber(int c)
1058 QDeclarativeDebugPropertyReference::QDeclarativeDebugPropertyReference()
1059 : m_objectDebugId(-1), m_hasNotifySignal(false)
1063 QDeclarativeDebugPropertyReference::QDeclarativeDebugPropertyReference(const QDeclarativeDebugPropertyReference &o)
1064 : m_objectDebugId(o.m_objectDebugId), m_name(o.m_name), m_value(o.m_value),
1065 m_valueTypeName(o.m_valueTypeName), m_binding(o.m_binding),
1066 m_hasNotifySignal(o.m_hasNotifySignal)
1070 QDeclarativeDebugPropertyReference &QDeclarativeDebugPropertyReference::operator=(const QDeclarativeDebugPropertyReference &o)
1072 m_objectDebugId = o.m_objectDebugId; m_name = o.m_name; m_value = o.m_value;
1073 m_valueTypeName = o.m_valueTypeName; m_binding = o.m_binding;
1074 m_hasNotifySignal = o.m_hasNotifySignal;
1078 int QDeclarativeDebugPropertyReference::objectDebugId() const
1080 return m_objectDebugId;
1083 QString QDeclarativeDebugPropertyReference::name() const
1088 QString QDeclarativeDebugPropertyReference::valueTypeName() const
1090 return m_valueTypeName;
1093 QVariant QDeclarativeDebugPropertyReference::value() const
1098 QString QDeclarativeDebugPropertyReference::binding() const
1103 bool QDeclarativeDebugPropertyReference::hasNotifySignal() const
1105 return m_hasNotifySignal;