forked from qt-creator/qt-creator
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:
@@ -387,12 +387,27 @@ class DumperBase:
|
|||||||
self.isCli = False
|
self.isCli = False
|
||||||
|
|
||||||
# Later set, or not set:
|
# Later set, or not set:
|
||||||
# cachedQtVersion
|
|
||||||
self.stringCutOff = 10000
|
self.stringCutOff = 10000
|
||||||
self.displayStringLimit = 100
|
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'.
|
# 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.
|
# This is a cache of all known dumpers.
|
||||||
self.qqDumpers = {}
|
self.qqDumpers = {}
|
||||||
@@ -407,18 +422,6 @@ class DumperBase:
|
|||||||
# to not be QObject derived, it contains a 0 value.
|
# to not be QObject derived, it contains a 0 value.
|
||||||
self.knownStaticMetaObjects = {}
|
self.knownStaticMetaObjects = {}
|
||||||
|
|
||||||
self.childrenPrefix = 'children=['
|
|
||||||
self.childrenSuffix = '],'
|
|
||||||
|
|
||||||
self.dumpermodules = [
|
|
||||||
"qttypes",
|
|
||||||
"stdtypes",
|
|
||||||
"misctypes",
|
|
||||||
"boosttypes",
|
|
||||||
"creatortypes",
|
|
||||||
"personaltypes",
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
def putNewline(self):
|
def putNewline(self):
|
||||||
pass
|
pass
|
||||||
@@ -1674,10 +1677,8 @@ class DumperBase:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def setupDumpers(self, _ = {}):
|
def setupDumpers(self, _ = {}):
|
||||||
self.qqDumpers = {}
|
|
||||||
self.qqFormats = {}
|
|
||||||
self.qqEditable = {}
|
|
||||||
self.typeCache = {}
|
self.typeCache = {}
|
||||||
|
self.resetCaches()
|
||||||
|
|
||||||
for mod in self.dumpermodules:
|
for mod in self.dumpermodules:
|
||||||
m = importlib.import_module(mod)
|
m = importlib.import_module(mod)
|
||||||
|
@@ -1031,6 +1031,13 @@ def qdump__QMultiMap(d, value):
|
|||||||
qdump__QMap(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):
|
def qdump__QMetaObjectPrivate(d, value):
|
||||||
d.putEmptyValue()
|
d.putEmptyValue()
|
||||||
d.putNumChild(1)
|
d.putNumChild(1)
|
||||||
|
Reference in New Issue
Block a user