Utilities/Startup.py

changeset 265
5805c2e1415b
parent 263
2b328d503567
child 432
497e188ee86e
child 514
a3e454b3293d
--- a/Utilities/Startup.py	Thu May 20 20:13:15 2010 +0200
+++ b/Utilities/Startup.py	Fri May 21 08:46:21 2010 +0200
@@ -141,6 +141,20 @@
     if not defaultIconPath in iconPaths:
         UI.PixmapCache.addSearchPath(defaultIconPath)
 
+def setLibraryPaths():
+    """
+    Module function to set the Qt library paths correctly for windows systems.
+    """
+    if Utilities.isWindowsPlatform():
+        from PyQt4 import pyqtconfig
+        libPath = os.path.join(pyqtconfig._pkg_config["pyqt_mod_dir"], "plugins")
+        if os.path.exists(libPath):
+            libPath = Utilities.fromNativeSeparators(libPath)
+            libraryPaths = QApplication.libraryPaths()
+            if libPath not in libraryPaths:
+                libraryPaths.insert(0, libPath)
+                QApplication.setLibraryPaths(libraryPaths)
+
 # the translator must not be deleted, therefore we save them here
 loaded_translators = {}
 
@@ -202,16 +216,7 @@
     app = E5Application(argv)
     app.setQuitOnLastWindowClosed(quitOnLastWindowClosed)
     
-    if Utilities.isWindowsPlatform():
-        libPath = os.path.join(Utilities.getPythonModulesDirectory(), 
-                               "PyQt", "plugins")
-        if os.path.exists(libPath):
-            libPath = Utilities.fromNativeSeparators(libPath)
-            libraryPaths = QApplication.libraryPaths()
-            if libPath not in libraryPaths:
-                libraryPaths.insert(0, libPath)
-                QApplication.setLibraryPaths(libraryPaths)
-
+    setLibraryPaths()
     initializeResourceSearchPath()
     QApplication.setWindowIcon(UI.PixmapCache.getIcon("eric.png"))
     

eric ide

mercurial