Debugger: Improve QObject dumper

Don't use two lookups for parent types and act on known null pointers.

While the machinery is robust enough to handle the result it's a
needless deviation in regular code path.

Change-Id: I6e50629cf554870a3ffb9f488f654e6ae557e5b3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2019-04-09 15:26:47 +02:00
parent b02f4ae615
commit 93d2e3352c

View File

@@ -1895,10 +1895,14 @@ class DumperBase:
if qobjectPtr:
qobjectType = self.createType('QObject')
qobjectPtrType = self.createType('QObject') # FIXME.
with SubItem(self, '[parent]'):
self.putField('sortgroup', 9)
self.putItem(self.createValue(parentPtr, qobjectPtrType))
if parentPtr:
self.putItem(self.createValue(parentPtr, qobjectType))
else:
self.putValue('0x0')
self.putType('QObject *')
self.putNumChild(0)
with SubItem(self, '[children]'):
self.putField('sortgroup', 8)
base = self.extractPointer(dd + 3 * ptrSize) # It's a QList<QObject *>