Open ImTomDaDude opened 3 weeks ago
I am also having the same issue. Did you find a solution? I'm having to edit the code manually every time it's generated.
Code generated: self.verticalLayout.addWidget(self.label, 0, Qt.AlignmentFlag.Qt.AlignmentFlag.AlignTop) Presumably should be: self.verticalLayout.addWidget(self.label, 0, Qt.AlignmentFlag.AlignTop)
no.
Traceback (most recent call last): File "C:\Users\TomDaDude\Desktop\FYP\main.py", line 67, in
window = MainWindow()
^^^^^^^^^^^^
File "C:\Users\TomDaDude\Desktop\FYP\main.py", line 28, in init
self.ui.setupUi(self)
File "C:\Users\TomDaDude\Desktop\FYP\src\ui_interface.py", line 38, in setupUi
self.verticalLayout.addWidget(self.label, 0, Qt.AlignmentFlag.Qt.AlignmentFlag.AlignTop)
^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'AlignmentFlag' has no attribute 'Qt'
The error I'am encountering indicates that the AlignmentFlag is being referenced incorrectly in my generated ui_interface.py file. The correct way to use alignment flags in PySide6 is to directly reference them from the Qt module, rather than through AlignmentFlag.
everytimes I update the .ui file, the .py file will generate the incorrect code, it only happens when I add vertical alignment
how to fix this.