diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-07-08 03:09:07 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-07-08 03:09:07 (GMT) |
commit | 76a1804b0fff9ffd092a551defe448d3e9d4346e (patch) | |
tree | 8907d76f7f3e0d1263dea252914c660e4cf37200 /src/declarative/debugger/qdeclarativedebug.cpp | |
parent | 4ec4ba7bde9ac321640c3e0c7b186f0b044423b7 (diff) | |
download | Qt-76a1804b0fff9ffd092a551defe448d3e9d4346e.zip Qt-76a1804b0fff9ffd092a551defe448d3e9d4346e.tar.gz Qt-76a1804b0fff9ffd092a551defe448d3e9d4346e.tar.bz2 |
Allow the debugger to modify method bodies
QTBUG-11933
Diffstat (limited to 'src/declarative/debugger/qdeclarativedebug.cpp')
-rw-r--r-- | src/declarative/debugger/qdeclarativedebug.cpp | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/src/declarative/debugger/qdeclarativedebug.cpp b/src/declarative/debugger/qdeclarativedebug.cpp index e4a991b..0c0cf2e 100644 --- a/src/declarative/debugger/qdeclarativedebug.cpp +++ b/src/declarative/debugger/qdeclarativedebug.cpp @@ -562,31 +562,37 @@ QDeclarativeDebugExpressionQuery *QDeclarativeEngineDebug::queryExpressionResult return query; } -QDeclarativeDebugExpressionQuery *QDeclarativeEngineDebug::setBindingForObject(int objectDebugId, - const QString &propertyName, - const QVariant &bindingExpression, - bool isLiteralValue, - QObject *parent) +bool QDeclarativeEngineDebug::setBindingForObject(int objectDebugId, const QString &propertyName, + const QVariant &bindingExpression, + bool isLiteralValue) { 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; + ds << QByteArray("SET_BINDING") << objectDebugId << propertyName << bindingExpression << isLiteralValue; d->client->sendMessage(message); + return true; } else { - query->m_state = QDeclarativeDebugQuery::Error; + return false; } +} - return query; +bool QDeclarativeEngineDebug::setMethodBody(int objectDebugId, const QString &methodName, + const QString &methodBody) +{ + Q_D(QDeclarativeEngineDebug); + + if (d->client->isConnected() && objectDebugId != -1) { + QByteArray message; + QDataStream ds(&message, QIODevice::WriteOnly); + ds << QByteArray("SET_METHOD_BODY") << objectDebugId << methodName << methodBody; + d->client->sendMessage(message); + return true; + } else { + return false; + } } QDeclarativeDebugWatch::QDeclarativeDebugWatch(QObject *parent) |