PyQt5 – setCheckState() method for Check Box
When we create a check box it has only two states that are checked and un-checked, although we can add an intermediate state using
setTristate method. We can set check box to be checked or un-checked using
setChecked but with this method we are unable to set check box to intermediate state.
setCheckState method is used to set the state of the check box it can be checked or un-checked even it can set intermediate state, it takes CheckState object as argument.
Syntax : checkbox.setCheckState(1)
Argument : It takes CheckState object as argument.
If we pass 0 to it, it set un-checked state to check box
If we pass 1 to it, it set intermediate state to check box
If we pass any other integer to it, it set checked state to check box
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. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course