Commit 39b0afaa authored by hjk's avatar hjk
Browse files

debugger: QObject dumper for Qt 5 was again broken



And still is (properties, signals, slots not visible), but at least
missing extraData does not stop the rest of the object dumping.

Change-Id: Iad203beee61d2ecfea63322d72aa9a231eb44291
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 264fe4ae
......@@ -798,10 +798,15 @@ def qdump__QObject(d, value):
staticMetaObject = value["staticMetaObject"]
d_ptr = value["d_ptr"]["d"].cast(privateType.pointer()).dereference()
#warn("D_PTR: %s " % d_ptr)
objectName = None
try:
objectName = d_ptr["objectName"]
except: # Qt 5
objectName = d_ptr["extraData"].dereference()["objectName"]
p = d_ptr["extraData"]
if not isNull(p):
objectName = p.dereference()["objectName"]
if not objectName is None:
d.putStringValue(objectName)
except:
d.putPlainChildren(value)
return
......@@ -833,13 +838,20 @@ def qdump__QObject(d, value):
#warn("MO.D: %s " % mo["d"])
metaData = mo["d"]["data"]
metaStringData = mo["d"]["stringdata"]
# This is char * in Qt 4 and ByteArrayData * in Qt 5.
# Force it to the char * data in the Qt 5 case.
try:
offset = metaStringData["offset"]
metaStringData = metaStringData.cast(lookupType('char*')) + int(offset)
except:
pass
#extradata = mo["d"]["extradata"] # Capitalization!
#warn("METADATA: %s " % metaData)
#warn("STRINGDATA: %s " % metaStringData)
#warn("TYPE: %s " % value.type)
#warn("INAME: %s " % d.currentIName())
#d.putValue("")
d.putStringValue(objectName)
#QSignalMapper::staticMetaObject
#checkRef(d_ptr["ref"])
d.putNumChild(4)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment