var QVariant test1 test2 var var toPyObject type var type dict var tes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
>>> var = QVariant({'test1' : 1, 'test2' : 2})
>>> var = var.toPyObject()
>>> type(var)
<type 'dict'>
>>> var['test1']
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyError: 'test1'
>>> var.keys()
[PyQt4.QtCore.QString(u'test1'), PyQt4.QtCore.QString(u'test2')]
>>>