debugger: don't hard code typeformats except for ints and strings

This commit is contained in:
hjk
2010-03-15 15:36:00 +01:00
parent 8ebe4e90cd
commit 0cd06f55bc
5 changed files with 23 additions and 24 deletions

View File

@@ -392,6 +392,7 @@ def qdump__QImage(d, item):
d.putValue("(%dx%d)" % (d_ptr["width"], d_ptr["height"]))
bits = d_ptr["data"]
nbytes = d_ptr["nbytes"]
d.putField("typeformats", "Normal,Displayed");
d.putNumChild(0)
#d.putNumChild(1)
if d.isExpanded(item):
@@ -401,12 +402,12 @@ def qdump__QImage(d, item):
d.putType(" ");
d.putNumChild(0)
d.putValue("size: %s bytes" % nbytes);
#d.putField("valuetooltipencoded", "6")
#d.putField("valuetooltip", encodeCharArray(bits, nbytes))
d.endHash()
d.endChildren()
format = d.itemFormat(item)
if format == 1:
if format == 0:
d.putField("editformat", 0) # Magic marker for "delete widget"
elif format == 1:
if False:
# Take four bytes at a time, this is critical for performance.
# In fact, even four at a time is too slow beyond 100x100 or so.
@@ -429,10 +430,8 @@ def qdump__QImage(d, item):
(filename, cleanAddress(p), cleanAddress(p + nbytes)))
d.putField("editformat", 3) # Magic marker for external "QImage" data.
d.beginItem("editvalue")
d.put(" %d" % int(d_ptr["width"]))
d.put(" %d" % int(d_ptr["height"]))
d.put(" %d" % int(d_ptr["format"]))
d.put(" %s" % filename)
d.put(" %d %d %d %s" % (d_ptr["width"], d_ptr["height"],
d_ptr["format"], filename))
d.endItem()