160 |
160 |
161 def setLibraryPaths(): |
161 def setLibraryPaths(): |
162 """ |
162 """ |
163 Module function to set the Qt library paths correctly for windows systems. |
163 Module function to set the Qt library paths correctly for windows systems. |
164 """ |
164 """ |
165 if Globals.isWindowsPlatform(): |
165 libPaths = ( |
166 libPath = os.path.join(Globals.getPyQt5ModulesDirectory(), "plugins") |
166 os.path.join(Globals.getPyQt5ModulesDirectory(), "plugins"), |
|
167 os.path.join(Globals.getPyQt5ModulesDirectory(), "Qt5", "plugins"), |
|
168 ) |
|
169 |
|
170 libraryPaths = QApplication.libraryPaths() |
|
171 for libPath in libPaths: |
167 if os.path.exists(libPath): |
172 if os.path.exists(libPath): |
168 libPath = QDir.fromNativeSeparators(libPath) |
173 libPath = QDir.fromNativeSeparators(libPath) |
169 libraryPaths = QApplication.libraryPaths() |
|
170 if libPath not in libraryPaths: |
174 if libPath not in libraryPaths: |
171 libraryPaths.insert(0, libPath) |
175 libraryPaths.insert(0, libPath) |
172 QApplication.setLibraryPaths(libraryPaths) |
176 QApplication.setLibraryPaths(libraryPaths) |
173 |
177 |
174 # the translator must not be deleted, therefore we save them here |
178 # the translator must not be deleted, therefore we save them here |
175 loaded_translators = {} |
179 loaded_translators = {} |
176 |
180 |
177 |
181 |