Debugger: Basic type display switching for QVariantMap items

This is not a complete solution (that would need to pass information
on typedefs and artificial types like "QVariant (QVariantMap)"
between dumper and gui, but allows switching to compact display
for individual items.

Change-Id: I47d15356e5decf9411af4acc8fa7a0f0cfbd045f
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
hjk
2015-07-10 10:09:25 +02:00
parent 0e80e4c128
commit 6f58f4ba50
2 changed files with 25 additions and 17 deletions

View File

@@ -387,12 +387,27 @@ class DumperBase:
self.isCli = False
# Later set, or not set:
# cachedQtVersion
self.stringCutOff = 10000
self.displayStringLimit = 100
self.resetCaches()
self.childrenPrefix = 'children=['
self.childrenSuffix = '],'
self.dumpermodules = [
"qttypes",
"stdtypes",
"misctypes",
"boosttypes",
"creatortypes",
"personaltypes",
]
def resetCaches(self):
# This is a cache mapping from 'type name' to 'display alternatives'.
self.qqFormats = {}
self.qqFormats = { "QVariant (QVariantMap)" : mapForms() }
# This is a cache of all known dumpers.
self.qqDumpers = {}
@@ -407,18 +422,6 @@ class DumperBase:
# to not be QObject derived, it contains a 0 value.
self.knownStaticMetaObjects = {}
self.childrenPrefix = 'children=['
self.childrenSuffix = '],'
self.dumpermodules = [
"qttypes",
"stdtypes",
"misctypes",
"boosttypes",
"creatortypes",
"personaltypes",
]
def putNewline(self):
pass
@@ -1674,10 +1677,8 @@ class DumperBase:
pass
def setupDumpers(self, _ = {}):
self.qqDumpers = {}
self.qqFormats = {}
self.qqEditable = {}
self.typeCache = {}
self.resetCaches()
for mod in self.dumpermodules:
m = importlib.import_module(mod)

View File

@@ -1031,6 +1031,13 @@ def qdump__QMultiMap(d, value):
qdump__QMap(d, value)
def qform__QVariantMap():
return mapForms()
def qdump__QVariantMap(d, value):
qdump__QMap(d, value)
def qdump__QMetaObjectPrivate(d, value):
d.putEmptyValue()
d.putNumChild(1)