Reputation: 1
In Qt designer when I make my UI's, the UI displays correctly. When I convert it to Python code and run the program it looks different and the text doesn't fit correctly.
QT Designer:
When I convert it to Python code and run the program:
Upvotes: 0
Views: 164
Reputation: 244301
The problem is caused because the .ui to .py converter (pyuic) does not use the same methodology as the QtDesigner previewer. This difference not only occurs with the QLabels but with other components, but since they are minimal differences then these are not observable.
A workaround for this case is to use the adjustSize() method after setting the text:
the_qlabel.adjustSize()
Upvotes: 1