Globals/__init__.py

changeset 2615
bdc9b4659826
parent 2614
9c49b4419ea7
child 2677
3d4277929fb3
child 2992
dbdf27746da5
--- a/Globals/__init__.py	Tue Apr 23 19:57:07 2013 +0200
+++ b/Globals/__init__.py	Wed Apr 24 18:16:34 2013 +0200
@@ -10,7 +10,7 @@
 import sys
 import os
 
-from PyQt4.QtCore import QDir
+from PyQt4.QtCore import QDir, QLibraryInfo
 
 # names of the various settings objects
 settingsNameOrganization = "Eric5"
@@ -165,6 +165,29 @@
     return os.path.join(distutils.sysconfig.get_python_lib(True), "PyQt4")
     
 
+def getQtBinariesPath():
+    """
+    Module function to get the path of the Qt binaries.
+    
+    @return path of the Qt binaries (string)
+    """
+    path = ""
+    if isWindowsPlatform():
+        # check for PyQt4 installer first (designer is test object)
+        modDir = getPyQt4ModulesDirectory()
+        if os.path.exists(os.path.join(modDir, "bin", "designer.exe")):
+            path = os.path.join(modDir, "bin")
+        elif os.path.exists(os.path.join(modDir, "designer.exe")):
+            path = modDir
+    
+    if not path:
+        path = QLibraryInfo.location(QLibraryInfo.BinariesPath)
+        if not os.path.exists(path):
+            path = ""
+    
+    return QDir.toNativeSeparators(path)
+
+
 ################################################################################
 ## functions for searching a Python2 interpreter
 ################################################################################

eric ide

mercurial