PyQt5 – How to auto resize Label | adjustSize QLabel
During the designing of the GUI (Graphical User Interface) application there is a need to display plain text as information where label is used, but sometimes information text could be large or much smaller and it is difficult to use
resize() method so have to auto adjust the size of the label according to the text, in order to do so
adjustSize() method can be used.
adjustSize() method will change the size of label according to the length of the text, if the length is less it will decrease the length and height of the widget and vice versa.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning - Basic Level Course
Syntax : label.adjustSize()
Argument : It takes no argument.