In this article we will see how we can disable the color effect of the label according to the user instruction such that when user check the radio button color effect should disappear and when user uncheck the radio button it should appear again.
In order to do this we have to do the following :
1. Create a label
2. Create a color effect object and set it to the label
3. Create a radio button
4. Add action to the radio button
5. Inside the action check if radio button is checked, it checked make color effect disable
6. Else make color effect enable
In order to make the color effect disable and enable we use
Syntax : color_effect.setEnabled(False)
Argument : It takes bool as argument
Return : It returns 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 QLabel - Disabling the blur effect according to the user
- PyQt5 QLabel - Disabling the opacity effect according to the user
- PyQt5 QLabel – Checking if the color effect is window type
- PyQt5 QLabel - Checking if the color effect is widget type
- PyQt5 QLabel - Checking if the color effect is disabled or not
- PyQt5 QLabel - Checking if the opacity effect is window type
- PyQt5 QLabel - Accessing blur radius of the blur effect
- PyQt5 QLabel - Setting blur radius to the blur effect
- PyQt5 QLabel - Adding blur effect
- PyQt5 QLabel - Checking if the blur effect is widget type
- PyQt5 QLabel - Checking if the blur effect is window type
- PyQt5 QLabel - Checking if the opacity effect is widget type
- PyQt5 Label – Setting color to the Color Effect
- PyQt5 Label – Accessing color of the Color Effect
- PyQt5 - Setting/Disabling the frame of ComboBox
- PyQt5 QCalendarWidget - Stopping functions by disabling
- PyQt5 QCalendarWidget - Enabling/Disabling Auto Fill Background Property
- PyQt5 QCalendarWidget - Enabling/Disabling Date Edit Pop-Up
- PyQt5 – How to auto resize Label | adjustSize QLabel
- PyQt5 – How to add border on QLabel ?
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.