In this article, we will see how we can hide the Label in the PyQt5 application. A label is a graphical control element which displays text on a form. It is usually a static control; having no interactivity. A label is generally used to identify a nearby text box or other widget.
In order to hide the label we use
setHidden() method, this method allows user to set if the widget should be visible or hidden, it belongs to the
Syntax : label.setHidden(True)
Argument : It takes bool as an argument.
As we can see the label 2 is hidden in the output window.
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 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
- PyQt5 – How to hide app from taskbar ?
- PyQt5 – How to hide the title bar of window ?
- PyQt5 – Hide push button on click
- PyQt5 - How to hide ComboBox when new item get selected
- PyQt5 - How to hide the items from drop down box in Combo Box
- PyQt5 – How to change text of pre-existing label | setText method
- PyQt5 – How to clear the content of label | clear and setText method
- PyQt5 – What's this help text for Label | setWhatsThis() method
- PyQt5 – How to set tooltip duration for Label | setToolTipDuration method
- PyQt5 – Access tool tip duration of label | ToolTipDuration method
- PyQt5 – Get tooltip data of label | toolTip() method
- PyQt5 - alignment() method for Label
- PyQt5 - Access the size of the Label
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.