In this article we will see how we can get the context menu policy of the QCalendarWidget. Context menu policy tells how the calendar will show the context menu, there are many policies available for the calendar like NoContextMenu, PreventContextMenu etc. By default calendar has DefaultContextMenu as context policy although we can change this with the help of
In order to do this we will use
contextMenuPolicymethod with the QCalendarWidget object.
Syntax : calendar.contextMenuPolicy()
Argument : It takes no argument
Return : It return Content Menu Policy object but when printed it shows the associated value of policy.
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.