diff options
author | Cristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> | 2020-06-03 11:46:35 +0200 |
---|---|---|
committer | Cristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> | 2020-06-16 15:03:17 +0200 |
commit | 67b971fea687b26e466a20fa01a830f9ac682c39 (patch) | |
tree | dcf5eb51875e20cb10b5859e1d92a5697a240a30 /sources | |
parent | f2e63d3588c8422d84d9ff5480427a83d68083bb (diff) |
Use pyside2-uic instead of uic for the loadUiType
Since we deploy the pyside2-uic wrapper inside the
bin/ directory of virtual environments, that takes care
of using the 'uic' binary we ship with the wheels,
which is located in site-packages/PySide2/.
The current implementation of loadUiType, runs 'uic -g python'
but for people without a Qt installation, it has no effect
since 'uic' is neither in PATH, nor in the system.
Using 'pyside2-uic' instead will solve this issue.
Task-number: PYSIDE-1223
Change-Id: I2c801a16c9ff4faa5cf8711bd718a634f017e592
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources')
-rw-r--r-- | sources/pyside2/PySide2/glue/qtuitools.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sources/pyside2/PySide2/glue/qtuitools.cpp b/sources/pyside2/PySide2/glue/qtuitools.cpp index 668b512e4..d81f6205a 100644 --- a/sources/pyside2/PySide2/glue/qtuitools.cpp +++ b/sources/pyside2/PySide2/glue/qtuitools.cpp @@ -137,16 +137,19 @@ if (uiFileName.isEmpty()) { Py_RETURN_NONE; } -QString uicBin("uic"); -QStringList uicArgs = {"-g", "python", QString::fromUtf8(uiFileName)}; +// Use the 'pyside2-uic' wrapper instead of 'uic' +// This approach is better than rely on 'uic' since installing +// the wheels cover this case. +QString uicBin("pyside2-uic"); +QStringList uicArgs = {QString::fromUtf8(uiFileName)}; QProcess uicProcess; uicProcess.start(uicBin, uicArgs); if (!uicProcess.waitForFinished()) { - qCritical() << "Cannot run 'uic': " << uicProcess.errorString() << " - " + qCritical() << "Cannot run 'pyside2-uic': " << uicProcess.errorString() << " - " << "Exit status " << uicProcess.exitStatus() << " (" << uicProcess.exitCode() << ")\n" - << "Check if 'uic' is in PATH"; + << "Check if 'pyside2-uic' is in PATH"; Py_RETURN_NONE; } QByteArray uiFileContent = uicProcess.readAllStandardOutput(); |