From ba94e9eb0130a3b9d75669ee38b0af66c6d3a346 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 22 Nov 2018 13:52:14 +0100 Subject: [PATCH] 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 --- src/plugins/debugger/qml/qmlinspectoragent.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/debugger/qml/qmlinspectoragent.cpp b/src/plugins/debugger/qml/qmlinspectoragent.cpp index 66dd51c0bde..8ef259e37c2 100644 --- a/src/plugins/debugger/qml/qmlinspectoragent.cpp +++ b/src/plugins/debugger/qml/qmlinspectoragent.cpp @@ -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(object, engineId)); handler->fetchMore(parentIname); return; // recursive } insertObjectInTree(object, parentId); - + if (objectDebugId == engineId) + updateObjectTree(m_rootContexts[engineId], engineId); } else { m_objectStack.push(QPair(object, engineId)); fetchObject(parentId);