Skip to content

Commit

Permalink
Use uic instead of pyside6-uic for loadUiType
Browse files Browse the repository at this point in the history
  • Loading branch information
senthilauto2023 authored and langlor-autodesk committed Jun 11, 2024
1 parent 1bb59a1 commit 8a88930
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions sources/pyside6/PySide6/glue/qtuitools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,16 @@ if (uiFileName.isEmpty()) {
Py_RETURN_NONE;
}

// Use the 'pyside6-uic' wrapper instead of 'uic'
// This approach is better than rely on 'uic' since installing
// the wheels cover this case.
QString uicBin("pyside6-uic");
QStringList uicArgs = {QString::fromUtf8(uiFileName)};
QString uicBin("uic");
QStringList uicArgs = {"-g", "python", QString::fromUtf8(uiFileName)};

QProcess uicProcess;
uicProcess.start(uicBin, uicArgs);
if (!uicProcess.waitForFinished()) {
qCritical() << "Cannot run 'pyside6-uic': " << uicProcess.errorString() << " - "
qCritical() << "Cannot run 'uic': " << uicProcess.errorString() << " - "
<< "Exit status " << uicProcess.exitStatus()
<< " (" << uicProcess.exitCode() << ")\n"
<< "Check if 'pyside6-uic' is in PATH";
<< "Check if 'uic' is in PATH";
Py_RETURN_NONE;
}
QByteArray uiFileContent = uicProcess.readAllStandardOutput();
Expand Down

0 comments on commit 8a88930

Please sign in to comment.