diff options
author | Lasse Holmstedt <lasse.holmstedt@nokia.com> | 2010-06-30 08:10:23 (GMT) |
---|---|---|
committer | Lasse Holmstedt <lasse.holmstedt@nokia.com> | 2010-06-30 08:16:45 (GMT) |
commit | ed82b3d0f93b9876201aa8145eafbaf4b50f2f36 (patch) | |
tree | 4af208b97ae052604a38addf8c39dfce40888b60 /src/declarative/debugger | |
parent | 730511f15bd619319e99fba484cf415b87a38052 (diff) | |
download | Qt-ed82b3d0f93b9876201aa8145eafbaf4b50f2f36.zip Qt-ed82b3d0f93b9876201aa8145eafbaf4b50f2f36.tar.gz Qt-ed82b3d0f93b9876201aa8145eafbaf4b50f2f36.tar.bz2 |
Added SET_BINDING message to QDeclarative debugger protocol
The new message currently enables resetting bindings, literal values and
signal handlers (onX: {...}) through the debugger.
Reviewed-by: Roberto Raggi
Diffstat (limited to 'src/declarative/debugger')
-rw-r--r-- | src/declarative/debugger/qdeclarativedebug.cpp | 29 | ||||
-rw-r--r-- | src/declarative/debugger/qdeclarativedebug_p.h | 20 |
2 files changed, 45 insertions, 4 deletions
diff --git a/src/declarative/debugger/qdeclarativedebug.cpp b/src/declarative/debugger/qdeclarativedebug.cpp index cd5340b..e4a991b 100644 --- a/src/declarative/debugger/qdeclarativedebug.cpp +++ b/src/declarative/debugger/qdeclarativedebug.cpp @@ -562,6 +562,33 @@ QDeclarativeDebugExpressionQuery *QDeclarativeEngineDebug::queryExpressionResult return query; } +QDeclarativeDebugExpressionQuery *QDeclarativeEngineDebug::setBindingForObject(int objectDebugId, + const QString &propertyName, + const QVariant &bindingExpression, + bool isLiteralValue, + QObject *parent) +{ + Q_D(QDeclarativeEngineDebug); + + QDeclarativeDebugExpressionQuery *query = new QDeclarativeDebugExpressionQuery(parent); + if (d->client->isConnected() && objectDebugId != -1) { + query->m_client = this; + query->m_expr = bindingExpression; + int queryId = d->getId(); + query->m_queryId = queryId; + d->expressionQuery.insert(queryId, query); + + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + ds << QByteArray("SET_BINDING") << queryId << objectDebugId << propertyName << bindingExpression << isLiteralValue; + d->client->sendMessage(message); + } else { + query->m_state = QDeclarativeDebugQuery::Error; + } + + return query; +} + QDeclarativeDebugWatch::QDeclarativeDebugWatch(QObject *parent) : QObject(parent), m_state(Waiting), m_queryId(-1), m_client(0), m_objectDebugId(-1) { @@ -698,7 +725,7 @@ QDeclarativeDebugExpressionQuery::~QDeclarativeDebugExpressionQuery() QDeclarativeEngineDebugPrivate::remove(m_client, this); } -QString QDeclarativeDebugExpressionQuery::expression() const +QVariant QDeclarativeDebugExpressionQuery::expression() const { return m_expr; } diff --git a/src/declarative/debugger/qdeclarativedebug_p.h b/src/declarative/debugger/qdeclarativedebug_p.h index 4ead232..007cbd7 100644 --- a/src/declarative/debugger/qdeclarativedebug_p.h +++ b/src/declarative/debugger/qdeclarativedebug_p.h @@ -94,7 +94,11 @@ public: QDeclarativeDebugExpressionQuery *queryExpressionResult(int objectDebugId, const QString &expr, QObject *parent = 0); - + QDeclarativeDebugExpressionQuery *setBindingForObject(int objectDebugId, + const QString &propertyName, + const QVariant &bindingExpression, + bool isLiteralValue, + QObject *parent = 0); private: Q_DECLARE_PRIVATE(QDeclarativeEngineDebug) }; @@ -198,6 +202,11 @@ public: private: friend class QDeclarativeEngineDebugPrivate; + QDeclarativeDebugExpressionQuery *setBindingForObject(int objectDebugId, + const QString &propertyName, + const QVariant &bindingExpression, + bool isLiteralValue, + QObject *parent); QUrl m_url; int m_lineNumber; int m_columnNumber; @@ -215,6 +224,11 @@ public: QString name() const; private: + QDeclarativeDebugExpressionQuery *setBindingForObject(int objectDebugId, + const QString &propertyName, + const QVariant &bindingExpression, + bool isLiteralValue, + QObject *parent); friend class QDeclarativeEngineDebugPrivate; int m_debugId; QString m_name; @@ -348,7 +362,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeDebugExpressionQuery : public QDeclarativ Q_OBJECT public: virtual ~QDeclarativeDebugExpressionQuery(); - QString expression() const; + QVariant expression() const; QVariant result() const; private: friend class QDeclarativeEngineDebug; @@ -356,7 +370,7 @@ private: QDeclarativeDebugExpressionQuery(QObject *); QDeclarativeEngineDebug *m_client; int m_queryId; - QString m_expr; + QVariant m_expr; QVariant m_result; }; |