Commits

Ciro Mattia Gonano committed bf009a5

Fallback to Qt libraries directory when looking for plugins

  • Participants
  • Parent commits cf645df
  • Branches qt5-platform

Comments (0)

Files changed (1)

cx_Freeze/hooks.py

 def copy_qt_plugins(plugins, finder):
     """Helper function to find and copy Qt plugins."""
     from PyQt4 import QtCore
-    for libpath in QtCore.QCoreApplication.libraryPaths():
+    # Qt Plugins can either be in a plugins directory next to the Qt libraries,
+    # or in other locations listed by QCoreApplication.libraryPaths()
+    dir0 = os.path.join(os.path.dirname(QtCore.__file__), "plugins")
+    for libpath in QtCore.QCoreApplication.libraryPaths() + [dir0]:
         sourcepath = os.path.join(str(libpath), plugins)
         if os.path.exists(sourcepath):
             finder.IncludeFiles(sourcepath, plugins)