Project/CreateDialogCodeDialog.py

changeset 5736
000ea446ff4b
parent 5389
9b1c800daff3
child 6048
82ad8ec9548c
--- a/Project/CreateDialogCodeDialog.py	Sat May 13 13:46:05 2017 +0200
+++ b/Project/CreateDialogCodeDialog.py	Sat May 13 16:32:54 2017 +0200
@@ -13,7 +13,7 @@
 import xml.etree.ElementTree
 
 from PyQt5.QtCore import QMetaObject, QByteArray, QRegExp, Qt, pyqtSlot, \
-    QMetaMethod, qVersion, QSortFilterProxyModel
+    QMetaMethod, QSortFilterProxyModel
 from PyQt5.QtGui import QStandardItemModel, QBrush, QStandardItem
 from PyQt5.QtWidgets import QWidget, QDialog, QDialogButtonBox, QAction
 from PyQt5 import uic
@@ -27,6 +27,9 @@
 
 from eric6config import getConfig
 
+from Globals import qVersionTuple
+
+
 pyqtSignatureRole = Qt.UserRole + 1
 pythonSignatureRole = Qt.UserRole + 2
 rubySignatureRole = Qt.UserRole + 3
@@ -258,7 +261,7 @@
                 for index in range(metaObject.methodCount()):
                     metaMethod = metaObject.method(index)
                     if metaMethod.methodType() == QMetaMethod.Signal:
-                        if qVersion() >= "5.0.0":
+                        if qVersionTuple() >= (5, 0, 0):
                             itm2 = QStandardItem("on_{0}_{1}".format(
                                 name,
                                 bytes(metaMethod.methodSignature()).decode()))
@@ -267,7 +270,7 @@
                                 name, metaMethod.signature()))
                         itm.appendRow(itm2)
                         if self.__module is not None:
-                            if qVersion() >= "5.0.0":
+                            if qVersionTuple() >= (5, 0, 0):
                                 method = "on_{0}_{1}".format(
                                     name,
                                     bytes(metaMethod.methodSignature())
@@ -308,7 +311,7 @@
                         methNamesSig = ", ".join(parameterNamesList)
                         
                         if methNamesSig:
-                            if qVersion() >= "5.0.0":
+                            if qVersionTuple() >= (5, 0, 0):
                                 pythonSignature = \
                                     "on_{0}_{1}(self, {2})".format(
                                         name,
@@ -322,7 +325,7 @@
                                         metaMethod.signature().split("(")[0],
                                         methNamesSig)
                         else:
-                            if qVersion() >= "5.0.0":
+                            if qVersionTuple() >= (5, 0, 0):
                                 pythonSignature = "on_{0}_{1}(self)".format(
                                     name,
                                     bytes(metaMethod.methodSignature())

eric ide

mercurial