debugger: python dumpers for QTextCursor and QTextDocument

(cherry picked from commit 34e0621552)

Reviewed-by: Friedemann Kleint
This commit is contained in:
hjk
2010-09-28 09:10:33 +02:00
parent 1a2e16aebd
commit 45b269b2d4
2 changed files with 26 additions and 3 deletions

View File

@@ -1480,12 +1480,12 @@ class Dumper:
#warn("IS DUMPABLE: %s " % type)
#self.putAddress(value.address)
self.putType(realtype)
if isQObjectDerived:
if nsStrippedType in qqDumpers:
qqDumpers[nsStrippedType](self, item)
elif isQObjectDerived:
# value has references stripped off item.value.
item1 = Item(value, item.iname)
qdump__QObject(self, item1)
else:
qqDumpers[nsStrippedType](self, item)
#warn(" RESULT: %s " % self.output)
return

View File

@@ -1651,6 +1651,29 @@ def qdump__QTextCodec(d, item):
d.putCallItem("mibEnum", item, "mibEnum()")
def qdump__QTextCursor(d, item):
p = item.value["d"]["d"].dereference()
d.putValue(p["position"])
d.putNumChild(1)
if d.isExpanded(item):
with Children(d):
d.putIntItem("position", p["position"])
d.putIntItem("anchor", p["anchor"])
d.putCallItem("selected", item, "selectedText()")
def qdump__QTextDocument(d, item):
d.putValue(" ")
d.putNumChild(1)
if d.isExpanded(item):
with Children(d):
d.putCallItem("blockCount", item, "blockCount()")
d.putCallItem("characterCount", item, "characterCount()")
d.putCallItem("lineCount", item, "lineCount()")
d.putCallItem("revision", item, "revision()")
d.putCallItem("toPlainText", item, "toPlainText()")
def qdump__QUrl(d, item):
data = item.value["d"].dereference()
d.putStringValue(data["encodedOriginal"])