aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2018-04-11 13:53:27 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2018-04-20 10:57:29 +0000
commita861c09fd13d4657191c2d447d7f7d3db5d42d5e (patch)
tree647f87bf9d02539e165c1294b98bec0d54191532 /sources/pyside2
parenta63bf4c49d29747ac1cfeaae2e802ad7ccd34336 (diff)
Fix QtWebEngineProcess related issues on the supported platforms
There were 2 issues: 1) QtWebEngineProcess could not be found on Windows because we have a non-standard directory layout for the Qt files we copy over (there is no bin directory), so we need to adjust the internal qt.conf which is set in pyside.cpp 2) QtWebEngineProcess itself does not use the qt.conf from pyside.cpp, because it is a separate executable, and thus we need to supply a qt.conf specifically for it which is placed in the libexec folder. Task-number: PYSIDE-626 Task-number: PYSIDE-631 Task-number: PYSIDE-642 Change-Id: I75d1b083fb5afe5dc31ba90174f42c7f559c5cd5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside2')
-rw-r--r--sources/pyside2/PySide2/CMakeLists.txt19
-rw-r--r--sources/pyside2/PySide2/qt.conf.in2
-rw-r--r--sources/pyside2/libpyside/pyside.cpp9
3 files changed, 29 insertions, 1 deletions
diff --git a/sources/pyside2/PySide2/CMakeLists.txt b/sources/pyside2/PySide2/CMakeLists.txt
index 971d0a9ef..651bf2734 100644
--- a/sources/pyside2/PySide2/CMakeLists.txt
+++ b/sources/pyside2/PySide2/CMakeLists.txt
@@ -13,6 +13,25 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/_config.py.in"
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/../pyside_version.py"
"${CMAKE_CURRENT_BINARY_DIR}/_git_pyside_version.py" @ONLY)
+# qt.conf needs to be placed next to QtWebEngineProcess so that the executable uses the correct
+# Prefix location leading to an existing icu data file. It is needed on Windows, Linux, and macOS
+# non-framework build. In framework build, instead of using qt.conf, Bundle querying is used.
+if (WIN32 OR (UNIX AND NOT APPLE) OR (APPLE AND NOT QtCore_is_framework))
+
+ if (WIN32)
+ # On Windows, the QtWebEngineProcess is directly located in the Prefix, due to not using
+ # a "Qt" subfolder like on the other platforms.
+ set(QT_CONF_PREFIX ".")
+ else()
+ # On Linux and non-framework macOS, the QtWebEngineProcess is in ./libexec, so prefix is one
+ # level higher.
+ set(QT_CONF_PREFIX "..")
+ endif()
+
+ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/qt.conf.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" @ONLY)
+endif()
+
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/support/__init__.py"
"${CMAKE_CURRENT_BINARY_DIR}/support/__init__.py" COPYONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/support/signature/__init__.py"
diff --git a/sources/pyside2/PySide2/qt.conf.in b/sources/pyside2/PySide2/qt.conf.in
new file mode 100644
index 000000000..ff5b0a30e
--- /dev/null
+++ b/sources/pyside2/PySide2/qt.conf.in
@@ -0,0 +1,2 @@
+[Paths]
+Prefix = @QT_CONF_PREFIX@
diff --git a/sources/pyside2/libpyside/pyside.cpp b/sources/pyside2/libpyside/pyside.cpp
index 4c7e6471c..1a59c87e0 100644
--- a/sources/pyside2/libpyside/pyside.cpp
+++ b/sources/pyside2/libpyside/pyside.cpp
@@ -494,7 +494,14 @@ bool registerInternalQtConf()
// rccData needs to be static, otherwise when it goes out of scope, the Qt resource system
// will point to invalid memory.
- static QByteArray rccData = QByteArray("[Paths]\nPrefix = ") + prefixPath.toLocal8Bit();
+ static QByteArray rccData = QByteArray("[Paths]\nPrefix = ") + prefixPath.toLocal8Bit()
+#ifdef Q_OS_WIN
+ // LibraryExecutables needs to point to Prefix instead of ./bin because we don't
+ // currently conform to the Qt default directory layout on Windows. This is necessary
+ // for QtWebEngineCore to find the location of QtWebEngineProcess.exe.
+ + QByteArray("\nLibraryExecutables = ") + prefixPath.toLocal8Bit()
+#endif
+ ;
rccData.append('\n');
// The RCC data structure expects a 4-byte size value representing the actual data.