Search code examples
pythonpython-3.xpyqt4qt-designer

Qt Designer showing a different output and Python file when run showing a different output


I am using Qt Designer for creating GUI files all work well for me in Qt Designer GUI window but if I run the generated file in Python it the text context is cut short, I need to know why this is happening? This image is the preview feature of Qt Designer:

This image is the preview feature of Qt Designer

This image is the output of the python file generated when the QtDesigner was converted to a python file and executed.:
This image is the output of the python file generated when the QtDesigner was converted to a python file and executed.


Solution

  • I suppose you are new in PyQt5.Sooner or later you will understand that whenever you create something in Qt designer like a button or a label,this item will be completely static.That means that whatever you create will be 'stuck' there with the absolute coordinates you defined and absolutelly zero interactivity.Here comes layers and minimum-maximum sizes of widgets.You can apparently just drag more your labels width manually from Qt Designer but this approach will not get you very far.Because this topic is rather big ,i will suggest playing more with Qt Designer and the inputs you can provide on the right tab ,and watch some tutorial about PyQt5 like this:https://www.youtube.com/watch?v=FVpho_UiDAY&ab_channel=TechWithTim