QML JS Debugger: Ability to edit properties from the debugger

This commit is contained in:
Olivier Goffart
2010-07-22 19:06:26 +02:00
parent f5249f0627
commit 3a88a829c3
2 changed files with 43 additions and 2 deletions

View File

@@ -517,7 +517,19 @@ void QmlEngine::setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEd
void QmlEngine::assignValueInDebugger(const QString &expression,
const QString &value)
{
XSDEBUG("ASSIGNING: " << expression + '=' + value);
QRegExp inObject("@([0-9a-fA-F]+)->(.+)");
if (inObject.exactMatch(expression)) {
bool ok = false;
quint64 objectId = inObject.cap(1).toULongLong(&ok, 16);
QString property = inObject.cap(2);
if (ok && objectId > 0 && !property.isEmpty()) {
QByteArray reply;
QDataStream rs(&reply, QIODevice::WriteOnly);
rs << QByteArray("SET_PROPERTY");
rs << expression.toUtf8() << objectId << property << value;
sendMessage(reply);
}
}
}
void QmlEngine::updateWatchData(const WatchData &data)