Added code to overcome an issue on windows platforms locating Qt plugins, if PyQt was installed via the installer.

Thu, 20 May 2010 20:11:27 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 20 May 2010 20:11:27 +0200
changeset 263
2b328d503567
parent 258
9402d145020d
child 264
01012080729b

Added code to overcome an issue on windows platforms locating Qt plugins, if PyQt was installed via the installer.

Utilities/Startup.py file | annotate | diff | comparison | revisions
eric5.py file | annotate | diff | comparison | revisions
--- a/Utilities/Startup.py	Sun May 16 19:57:46 2010 +0200
+++ b/Utilities/Startup.py	Thu May 20 20:11:27 2010 +0200
@@ -201,6 +201,16 @@
     handleArgs(argv, appinfo)
     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)
 
     initializeResourceSearchPath()
     QApplication.setWindowIcon(UI.PixmapCache.getIcon("eric.png"))
--- a/eric5.py	Sun May 16 19:57:46 2010 +0200
+++ b/eric5.py	Thu May 20 20:11:27 2010 +0200
@@ -176,6 +176,16 @@
     
     app = E5Application(sys.argv)
     
+    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)
+
     # set the searchpath for icons
     Startup.initializeResourceSearchPath()
 

eric ide

mercurial