aboutsummaryrefslogtreecommitdiffstats
path: root/PySide/__init__.py.in
diff options
context:
space:
mode:
authorRoman Lacko <backup.rlacko@gmail.com>2013-07-24 15:19:22 +0200
committerJohn Ehresman <jpe@wingware.com>2013-08-12 23:24:05 +0200
commitd2a47ab8f27af7e74d34797464da85c128c17c37 (patch)
tree6b30d846bb23dbb3f0e5f497a23149c74c8d576d /PySide/__init__.py.in
parenta12de51b654973d965b1888b4dd3c539422f71db (diff)
Register qt.conf in Qt resource system to override the Qt builtins
Register qt.conf in Qt resource system to override the built-in configuration variables if there is no default qt.conf in executable folder and qt.conf was not already registered in Qt resource system Change-Id: Ibed9f9e791dab575ef26bc54b351e5f5d4870542 Reviewed-by: John Ehresman <jpe@wingware.com>
Diffstat (limited to 'PySide/__init__.py.in')
-rw-r--r--PySide/__init__.py.in34
1 files changed, 10 insertions, 24 deletions
diff --git a/PySide/__init__.py.in b/PySide/__init__.py.in
index 183df2d30..5dd82ed9f 100644
--- a/PySide/__init__.py.in
+++ b/PySide/__init__.py.in
@@ -10,6 +10,16 @@ def _setupQtDirectories():
pysideDir = _utils.get_pyside_dir()
+ # Register PySide qt.conf to override the built-in
+ # configuration variables, if there is no default qt.conf in
+ # executable folder
+ prefix = pysideDir.replace('\\', '/')
+ _utils.register_qt_conf(prefix=prefix,
+ binaries=prefix,
+ plugins=prefix+"/plugins",
+ imports=prefix+"/imports",
+ translations=prefix+"/translations")
+
# On Windows add the PySide\openssl folder (if it exists) to the
# PATH so the SSL DLLs can be found when Qt tries to dynamically
# load them. Tell Qt to load them and then reset the PATH.
@@ -28,28 +38,4 @@ def _setupQtDirectories():
finally:
os.environ['PATH'] = path
- # Tell Qt to look for plugins in the PySide package, if the
- # plugins folder exists there, instead of just the default of
- # looking only in Qt's install or build folder.
- try:
- from . import QtCore
- except ImportError:
- pass
- else:
- pluginsDir = os.path.join(pysideDir, 'plugins')
- if os.path.exists(pluginsDir) and \
- pluginsDir not in QtCore.QCoreApplication.libraryPaths():
- QtCore.QCoreApplication.addLibraryPath(pluginsDir)
-
- # Tell Qt to look for qml imports in the PySide package, if the
- # imports folder exists there.
- importsDir = os.path.join(pysideDir, 'imports')
- if os.path.exists(importsDir):
- if 'QML_IMPORT_PATH' in os.environ:
- qml_import_path = os.environ['QML_IMPORT_PATH']
- os.environ['QML_IMPORT_PATH'] = importsDir + os.pathsep + qml_import_path
- else:
- os.environ['QML_IMPORT_PATH'] = importsDir
-
-
_setupQtDirectories()