Priority: P3: Somewhat important
Affects Version/s: 5.13.2
Fix Version/s: None
I've noticed when converting .ui files that contained QTableWidget (when its columns were specified), that the resultant .py file created using PySide2-uic is incorrect because the column index is printed inside the .py file. If the column index is at the top of the file (like shown below) then the 'setupUI' function will work as expected, however occasionally if the UI form is more complex, the column index would be printed within one of the function (e.g. retranslateUi) and then 'setupUI' would fail.
The problem only occurs when using pyside2-uic with the > operator and not the -o option.
Looking at the source code of the pyside2uic project, I think it is caused by a print statement in the uiparser.py file, function addHeader. Here is a snippet
Here is an example of a UI file that will result in incorrect .py file
Which produces this code when using
pyside2-uic.exe .\test.ui > .\ui_test.py