def load(self, value, parent=None):
    rootItem = QJsonTreeItem(parent)
    rootItem.setKey('root')
    jsonType = None
    jsonType = value.__class__.__name__
    if isinstance(value, dict):
        for key in value:
            v = value[key]
            child = self.load(v, rootItem)
            child.setKey(key)
            child.setType(v.__class__.__name__)
            rootItem.appendChild(child)
    elif isinstance(value, list):
        for (i, v) in enumerate(value):
            child = self.load(v, rootItem)
            child.setKey(str(i))
            child.setType(v.__class__)
            rootItem.appendChild(child)
    else:
        rootItem.setValue(value)
        try:
            rootItem.setType(value.type())
        except AttributeError:
            if (jsonType is not None):
                rootItem.setType(jsonType)
            else:
                rootItem.setType(value.__class__)
    return rootItem
def load(self, value, parent=None):
    rootItem = QJsonTreeItem(parent)
    rootItem.setKey('root')
    jsonType = None
    jsonType = value.__class__.__name__
    if isinstance(value, dict):
        for key in value:
            v = value[key]
            child = self.load(v, rootItem)
            child.setKey(key)
            child.setType(v.__class__.__name__)
            rootItem.appendChild(child)
    elif isinstance(value, list):
        for (i, v) in enumerate(value):
            child = self.load(v, rootItem)
            child.setKey(str(i))
            child.setType(v.__class__)
            rootItem.appendChild(child)
    else:
        rootItem.setValue(value)
        try:
            rootItem.setType(value.type())
        except AttributeError:
            if (jsonType is not None):
                rootItem.setType(jsonType)
            else:
                rootItem.setType(value.__class__)
    return rootItem