From 1df4757daed42f2e182e85344122f861f93683e2 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 14 Mar 2017 19:00:36 +0100 Subject: [PATCH] Qml Inspector: Don't ignore anonymous objects Apparently the inspector service does not send a type string for all objects. As the id string and the object name can also be empty, those objects are anonymous then. Try to identify them by their source location and if that doesn't work, just call them "". Change-Id: I3bd3bad8b78c81ace95bfd7813cdd8bb0f5e14f2 Task-number: QTCREATORBUG-17741 Reviewed-by: hjk --- src/plugins/debugger/qml/qmlinspectoragent.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/plugins/debugger/qml/qmlinspectoragent.cpp b/src/plugins/debugger/qml/qmlinspectoragent.cpp index 0f430bb45ee..132369fea71 100644 --- a/src/plugins/debugger/qml/qmlinspectoragent.cpp +++ b/src/plugins/debugger/qml/qmlinspectoragent.cpp @@ -606,7 +606,15 @@ void QmlInspectorAgent::addWatchData(const ObjectReference &obj, name = obj.className(); if (name.isEmpty()) - return; + name = obj.name(); + + if (name.isEmpty()) { + FileReference file = obj.source(); + name = file.url().fileName() + ':' + QString::number(file.lineNumber()); + } + + if (name.isEmpty()) + name = tr(""); // object auto objWatch = new WatchItem;