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 –
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 – How to change size of the Label | label.resize method
- PyQt5 – Change the text font and size in Push button
- PYGLET – Accessing Label Text Font Size Property
- PyQt5 Scrollable Label - Getting tool tip text of the label part
- wxPython - Change Button Label Font
- PyQt5 – How to change text of pre-existing label | setText method
- PYGLET – Accessing Label Text Font Name Property
- Python PyQt5 – How to change font and size of Status Bar Message
- PyQt5 – How to hide label | label.setHidden method
- PyQt5 Scrollable Label - Setting tool tip to 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
- PyQt5 QSpinBox - Matching font with the System Font
- How to change the Tkinter label text?
- wxPython - Change font for text present in Radio Box
- PyQt5 - How to change style and size of text Progress Bar ?
- PyQt5 – How to change color of the label ?
- PyQt5 – Change background color of Label for anti hover state
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.