A label is a graphical control element which displays text on a form. A label is generally used to identify a nearby text box or other widget. Some labels can respond to events such as mouse clicks, allowing the text of the label to be copied, but this is not standard user-interface practice.
In this article, we will see how to change the font and size of the text in Label, we can do this by using
Syntax : label.setFont(QFont(font_name, size))
Argument : It take two argument :
1. Font name it can be ‘Arial’, ‘Times’ etc.
2. Size to be set in integer.
Below is the Python implementation –
- PyQt5 – Change the text font and size in Push button
- PyQt5 – How to change size of the Label | label.resize method
- PyQt5 – How to change text of pre-existing label | setText method
- Python PyQt5 – How to change font and size of Status Bar Message
- PyQt5 - How to change style and size of text Progress Bar ?
- wxPython - Change Button Label Font
- PyQt5 Scrollable Label - Getting tool tip text of the label part
- wxPython - Change font for text present in Radio Box
- PyQt5 – How to change color of the label ?
- PyQt5 QSpinBox - Setting font to the whole text
- PyQt5 QSpinBox - How to get the elided text through font
- PyQt5 - Getting text of scrollable label
- PyQt5 – How to align Text of Label
- PyQt5 – What's this help text for Label | setWhatsThis() method
- PyQt5 QSpinBox - Getting the size of the font
- PyQt5 – Change background color of Label for anti hover state
- PyQt5 Scrollable Label - Retrieving tooltip text
- PyQt5 - Access the size of the Label
- PyQt5 QSpinbox - Dragging text from it and dropping it to Custom Label
- PyQt5 - Font and size of content in Radio button
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.