Globals/__init__.py

changeset 5070
4e4651e88674
parent 4828
b313794f46a2
child 5389
9b1c800daff3
--- a/Globals/__init__.py	Wed Jul 27 15:38:27 2016 +0200
+++ b/Globals/__init__.py	Wed Jul 27 18:10:08 2016 +0200
@@ -188,9 +188,15 @@
     
     @return path of the Qt binaries (string)
     """
+    import Preferences
+    
     path = ""
-    if isWindowsPlatform():
-        # check for PyQt5 installer first (designer is test object)
+    
+    # step 1: check, if the user has configured a tools path
+    path = Preferences.getQt("QtToolsDir")
+    
+    if not path and isWindowsPlatform():
+        # step 2.1: check for PyQt5 Windows installer (designer is test object)
         modDir = getPyQt5ModulesDirectory()
         if os.path.exists(os.path.join(modDir, "bin", "designer.exe")):
             path = os.path.join(modDir, "bin")
@@ -198,6 +204,8 @@
             path = modDir
     
     if not path:
+        # step 2.2: get the path from Qt
+        # Note: no Qt tools are to found there for PyQt 5.7.0
         path = QLibraryInfo.location(QLibraryInfo.BinariesPath)
         if not os.path.exists(path):
             path = ""

eric ide

mercurial