Attempt to make usable the wizard for the pyqt<4.4.4 users
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 12 Jan 2009 09:51:47 +0000 (09:51 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 12 Jan 2009 09:51:47 +0000 (09:51 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2158 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BCpuPage.py
wizard/BToolchainPage.py
wizard/BToolchainSearch.py
wizard/BVersionPage.py
wizard/BWizardPage.py
wizard/qvariant_converter_old.py [new file with mode: 0644]

index 6494e34d89710fa547bb2f6f94c8308f9dca76fc..e329dbc866d279557cee07037aa8d92fb0a0415d 100644 (file)
 
 from BWizardPage import *
 import bertos_utils
-import qvariant_converter
+if PYQT_VERSION_STR > "4.4.3":
+    import qvariant_converter_new as qvariant_converter
+else:
+    import qvariant_converter_old as qvariant_converter
 
 class BCpuPage(BWizardPage):
     
index 2383c3933a5c8c40a4927a65ef0223fff39ebd89..164f132432121d4d997a7b104c192f80eb319dd9 100644 (file)
@@ -14,7 +14,10 @@ import os
 from BWizardPage import *
 import BToolchainSearch
 import bertos_utils
-import qvariant_converter
+if PYQT_VERSION_STR > "4.4.3":
+    import qvariant_converter_new as qvariant_converter
+else:
+    import qvariant_converter_old as qvariant_converter
 
 class BToolchainPage(BWizardPage):
     
index c2f57e346cbbcfef9d4fff9ea2390c1a21cda64d..48f8c764b48d60153e9e0c0f63a4b986d13f4c08 100644 (file)
@@ -13,7 +13,10 @@ from PyQt4.QtCore import *
 from PyQt4.QtGui import *
 import PyQt4.uic as uic
 
-import qvariant_converter
+if PYQT_VERSION_STR > "4.4.3":
+    import qvariant_converter_new as qvariant_converter
+else:
+    import qvariant_converter_old as qvariant_converter
 
 class BToolchainSearch(QDialog):
     
index 2f5a62605b9c3b833611964d91316b4d743e6709..1d078565794d51c3f93c55341ae52c3104477592 100644 (file)
 from PyQt4.QtGui import *
 from BWizardPage import *
 import bertos_utils
-import qvariant_converter
+if PYQT_VERSION_STR > "4.4.3":
+    import qvariant_converter_new as qvariant_converter
+else:
+    import qvariant_converter_old as qvariant_converter
 
 class BVersionPage(BWizardPage):
     
index b4fc6217025419c244c07c57af0743e68ca89319..f7b60c37309599b25a3afd6ae4d30e8784a968cd 100644 (file)
@@ -13,7 +13,10 @@ from PyQt4.QtCore import *
 from PyQt4.QtGui import *
 from PyQt4 import uic
 
-import qvariant_converter
+if PYQT_VERSION_STR > "4.4.3":
+    import qvariant_converter_new as qvariant_converter
+else:
+    import qvariant_converter_old as qvariant_converter
 
 class BWizardPage(QWizardPage):
     
diff --git a/wizard/qvariant_converter_old.py b/wizard/qvariant_converter_old.py
new file mode 100644 (file)
index 0000000..0a41919
--- /dev/null
@@ -0,0 +1,53 @@
+#!/usr/bin/env python
+# encoding: utf-8
+#
+# Copyright 2009 Develer S.r.l. (http://www.develer.com/)
+# All rights reserved.
+#
+# $Id:$
+#
+# Author: Lorenzo Berni <duplo@develer.com>
+#
+
+from PyQt4.QtCore import *
+
+def getString(qvariant):
+    string = qvariant.toPyObject()
+    return string
+
+def convertString(string):
+    return QVariant(string)
+
+def getStringList(qvariant):
+    string_list = qvariant.toPyObject()
+    return string_list
+
+def convertStringList(string_list):
+    return QVariant(string_list)
+
+def getStringDict(qvariant):
+    dict_str_str = qvariant.toPyObject()
+    return dict_str_str
+
+def convertStringDict(string_dict):
+    return QVariant(string_dict)
+
+def getBool(qvariant):
+    return qvariant.toBool()
+
+def convertBool(boolean):
+    return QVariant(boolean)
+
+def getBoolDict(qvariant):
+    dict_str_bool = qvariant.toPyObject()
+    return dict_str_bool
+
+def convertBoolDict(dict_str_bool):
+    return QVariant(dict_str_bool)
+
+def getDict(qvariant):
+    dict_str_variant = qvariant.toPyObject()
+    return dict_str_variant
+
+def convertDict(dict_str_variant):
+    return QVariant(dict_str_variant)