In this article we will see how we can set the focus policy to the QCalendarWidget. This property holds the way the widget accepts keyboard focus, there are many focus policy available for calendar like no focus, strong focus, wheel focus etc.
In order to do this we will use
setFocusPolicymethod with the QCalendarWidget object.
Syntax : calendar.setFocusPolicy(Qt.NoFocus)
Argument : It takes focus policy as argument
Return : It return 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.