In this article we will see how we can create a multi-line label, when we create a label and set text to it and if the text length is greater then the length of the label extra text did not show, multi-line label make that extra text go into the other line. Below is the representation of how normal and multi-line label looks like
In order to do this we will use
Syntax : label.setWordWrap(True)
Argument : It takes bool as argument
Return : None
Below is the implementation
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.
- PyQt5 - Checking if label is multi line or not
- PyQt5 – How to hide label | label.setHidden method
- PyQt5 – How to change size of the Label | label.resize method
- PyQt5 Scrollable Label - Setting tool tip to the label part
- PyQt5 Scrollable Label - Getting tool tip text of the label part
- PyQt5 Scrollable Label – Setting tool tip duration to label part
- PyQt5 Scrollable Label – Getting tool tip duration of the label part
- PyQt5 Label – Checking if label is window type
- PyQt5 Label – Checking if label is widget type
- Multi-Label Image Classification - Prediction of image labels
- Multi-Line printing in Python
- Interesting Fact about Python Multi-line Comments
- PYGLET – Accessing Multi Line Property of Incremental Text Layout
- PyQt5 – Create multi-color border of StatusBar
- PyQt5 - Multi colored border Progress Bar
- PyQt5 - Multi colored border to bar of Progress Bar
- PyQt5 - Access the size of the Label
- How to create Label widget in PyQt5 ?
- Setting and accessing name of a Label - PyQt5
- PyQt5 – How to change text of pre-existing label | setText method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.