Commit 47f9622e authored by Kai Koehne's avatar Kai Koehne Committed by Kai Koehne

Fix QML watch expressions for v8

Fix syncing of watch expressions with Qt Quick 2. For v8/v4 we're
utilizing the 'evaluate' command, which we have to re-send on every
change to get updates. We therefore now call synchronizeWatchers()
whenever the stack changes.

Task-number: QTCREATORBUG-13473
Change-Id: I7356e9518a719839c5cbb6e518be18e665078e85
Reviewed-by: default avatarUlf Hermann <ulf.hermann@theqtcompany.com>
Reviewed-by: default avatarRobert Loehning <robert.loehning@theqtcompany.com>
parent 245ea908
......@@ -1176,6 +1176,8 @@ void QmlEngine::updateCurrentContext()
context = grandParentData->name;
}
synchronizeWatchers();
QmlJS::ConsoleManagerInterface *consoleManager = qmlConsoleManager();
if (consoleManager)
consoleManager->setContext(tr("Context:") + QLatin1Char(' ') + context);
......
......@@ -135,7 +135,6 @@ public:
QList<int> debuggerCommands;
//Cache
QStringList watchedExpressions;
QList<int> currentFrameScopes;
QHash<int, int> stackIndexLookup;
......@@ -722,9 +721,7 @@ QmlV8ObjectData extractData(const QVariant &data, const QVariant &refsVal)
void QmlV8DebuggerClientPrivate::clearCache()
{
watchedExpressions.clear();
currentFrameScopes.clear();
evaluatingExpression.clear();
updateLocalsAndWatchers.clear();
}
......@@ -958,15 +955,12 @@ void QmlV8DebuggerClient::synchronizeWatchers(const QStringList &watchers)
{
SDEBUG(watchers);
foreach (const QString &exp, watchers) {
if (!d->watchedExpressions.contains(exp)) {
StackHandler *stackHandler = d->engine->stackHandler();
if (stackHandler->isContentsValid() && stackHandler->currentFrame().isUsable()) {
d->evaluate(exp, false, false, stackHandler->currentIndex());
d->evaluatingExpression.insert(d->sequence, exp);
}
StackHandler *stackHandler = d->engine->stackHandler();
if (stackHandler->isContentsValid() && stackHandler->currentFrame().isUsable()) {
d->evaluate(exp, false, false, stackHandler->currentIndex());
d->evaluatingExpression.insert(d->sequence, exp);
}
}
d->watchedExpressions = watchers;
}
void QmlV8DebuggerClient::expandObject(const QByteArray &iname, quint64 objectId)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment