aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/plugins
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-05-10 21:23:06 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-05-11 07:46:14 +0200
commit1da27a40a71e61f4ac4bc83819ade1461efb17fc (patch)
tree260fb6b525b53ab1275cc394a8b89d14df988856 /sources/pyside6/plugins
parentd075757286e0b7fbbef118eee4720671d48fc91b (diff)
PySide6: Use the Python version the plugin is running under
Pick-to: 6.1 6.1.0 Task-number: PYSIDE-1455 Change-Id: Iba9429d2c42f471661b250829aaf124a4b8b72b2 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside6/plugins')
-rw-r--r--sources/pyside6/plugins/designer/designercustomwidgets.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/sources/pyside6/plugins/designer/designercustomwidgets.cpp b/sources/pyside6/plugins/designer/designercustomwidgets.cpp
index 92455cc24..65074c546 100644
--- a/sources/pyside6/plugins/designer/designercustomwidgets.cpp
+++ b/sources/pyside6/plugins/designer/designercustomwidgets.cpp
@@ -163,9 +163,17 @@ static void initVirtualEnvironment()
// As of Python 3.8/Windows, Python is no longer able to run stand-alone in
// a virtualenv due to missing libraries. Add the path to the modules
// instead.
+ bool ok;
+ int majorVersion = qEnvironmentVariableIntValue("PY_MAJOR_VERSION", &ok);
+ int minorVersion = qEnvironmentVariableIntValue("PY_MINOR_VERSION", &ok);
+ if (!ok) {
+ majorVersion = PY_MAJOR_VERSION;
+ minorVersion = PY_MINOR_VERSION;
+ }
+
if (!qEnvironmentVariableIsSet(virtualEnvVar)
|| QOperatingSystemVersion::currentType() != QOperatingSystemVersion::Windows
- || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 8)) {
+ || (majorVersion == 3 && minorVersion < 8)) {
return;
}