Try to resolve problems with QVariant API changing
[bertos.git] / wizard / qvariant_converter_newer.py
index 5335032f631000c4b63867003362f8bcb1955e51..30317e8f0c067d155be5e299a0499cc96d679ef0 100644 (file)
@@ -28,7 +28,7 @@
 #
 # Copyright 2009 Develer S.r.l. (http://www.develer.com/)
 #
-# $Id:$
+# $Id$
 #
 # Author: Lorenzo Berni <duplo@develer.com>
 #
@@ -56,8 +56,8 @@ def convertStringList(string_list):
 def getStringDict(qvariant):
     dict_str_str = {}
     try:
-        for key, value in qvariant.toPyObject().items():
-            dict_str_str[unicode(key)] = unicode(value)
+        for key, value in qvariant.toMap().items():
+            dict_str_str[unicode(key)] = unicode(value.toString())
     except:
         pass
     return dict_str_str
@@ -92,7 +92,7 @@ def convertBoolDict(dict_str_bool):
 def getDict(qvariant):
     dict_str_variant = {}
     try:
-        for key, value in qvariant.toPyObject().items():
+        for key, value in qvariant.toMap().items():
             dict_str_variant[unicode(key)] = value
     except:
         pass