forked from qt-creator/qt-creator
Debugger: Fix retrieval of Locals Views subitems in QML debugger
Previously, only the first level of properties was expanded, properties of object type could not be expanded further. This can be reproduced by opening the SameGame example, putting and triggering a breakpoint at startNewGame(), expanding the 'this' entry in the Locals view and checking the 'component' subentry. Change-Id: I6cf714af697ab4eebd7eb0ae0ea37e516b3ea635 Reviewed-by: Robert Loehning <robert.loehning@theqtcompany.com> Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
This commit is contained in:
@@ -2353,6 +2353,8 @@ ConsoleItem *QmlEnginePrivate::constructLogItemTree(ConsoleItem *parent,
|
||||
void QmlEnginePrivate::insertSubItems(WatchItem *parent, const QVariantList &properties)
|
||||
{
|
||||
QTC_ASSERT(parent, return);
|
||||
LookupItems itemsToLookup;
|
||||
|
||||
foreach (const QVariant &property, properties) {
|
||||
QmlV8ObjectData propertyData = extractData(property);
|
||||
auto item = new WatchItem;
|
||||
@@ -2374,15 +2376,20 @@ void QmlEnginePrivate::insertSubItems(WatchItem *parent, const QVariantList &pro
|
||||
item->id = propertyData.handle;
|
||||
item->type = propertyData.type;
|
||||
item->value = propertyData.value.toString();
|
||||
item->setHasChildren(propertyData.properties.count());
|
||||
if (item->type.isEmpty())
|
||||
itemsToLookup.insert(propertyData.handle, {item->iname, item->name});
|
||||
item->setHasChildren(propertyData.properties.count() > 0);
|
||||
parent->appendChild(item);
|
||||
}
|
||||
|
||||
if (boolSetting(SortStructMembers))
|
||||
if (boolSetting(SortStructMembers)) {
|
||||
parent->sortChildren([](const TreeItem *item1, const TreeItem *item2) -> bool {
|
||||
return static_cast<const WatchItem *>(item1)->name
|
||||
< static_cast<const WatchItem *>(item2)->name;
|
||||
< static_cast<const WatchItem *>(item2)->name;
|
||||
});
|
||||
}
|
||||
|
||||
lookup(itemsToLookup);
|
||||
}
|
||||
|
||||
void QmlEnginePrivate::handleExecuteDebuggerCommand(const QVariantMap &response)
|
||||
|
||||
Reference in New Issue
Block a user