QML Debugger: Do fetch engine properties

The properties of the engines themselves are interesting. However, in
order to properly display the engines, we need to always update the root
context for an engine after we update its properties. This is a good
idea anyway because there might be a reference to the engine somewhere
else in the object tree, and accidentally updating the engine would
clear its root context.

Change-Id: If905f4c32ba37106b5620b5af0e157e19ef8b295
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Ulf Hermann
2018-11-22 13:52:14 +01:00
parent 0eca4bce72
commit ba94e9eb01

View File

@@ -273,9 +273,9 @@ void QmlInspectorAgent::onResult(quint32 queryId, const QVariant &value,
verifyAndInsertObjectInTree(ObjectReference(engine.debugId(), name),
engine.debugId());
updateObjectTree(m_rootContexts[engine.debugId()], engine.debugId());
fetchObject(engine.debugId());
}
m_rootContextQueryIds.clear();
m_rootContexts.clear();
}
}
}
@@ -378,6 +378,7 @@ void QmlInspectorAgent::queryEngineContext()
log(LogSend, "LIST_OBJECTS");
m_rootContexts.clear();
for (const auto &engine : qAsConst(m_engines))
m_rootContextQueryIds.append(m_engineClient->queryRootContexts(engine));
}
@@ -471,14 +472,14 @@ void QmlInspectorAgent::verifyAndInsertObjectInTree(const ObjectReference &objec
if (m_debugIdToIname.contains(parentId)) {
QString parentIname = m_debugIdToIname.value(parentId);
if (parentId != WatchItem::InvalidId && parentId != engineId
&& !handler->isExpandedIName(parentIname)) {
if (parentId != WatchItem::InvalidId && !handler->isExpandedIName(parentIname)) {
m_objectStack.push(QPair<ObjectReference, int>(object, engineId));
handler->fetchMore(parentIname);
return; // recursive
}
insertObjectInTree(object, parentId);
if (objectDebugId == engineId)
updateObjectTree(m_rootContexts[engineId], engineId);
} else {
m_objectStack.push(QPair<ObjectReference, int>(object, engineId));
fetchObject(parentId);