PyQt5 QCalendarWidget – Inserting QAction
In this article we will see how we can insert QAction to the QCalendarWidget. In order to do this we use
insertAction method, this method inserts the action to the calendar’s list of actions, before the given action. It appends the action if before is None or before is not a valid action for this widget.
In order to do this we will use
insertActionmethod with the QCalendarWidget object.
Syntax : calendar.insertAction(before, action)
Argument : It takes two QAction object as argument as argument, first is the QAction which is already added and second is the QAction which will be inserted before the ‘before’ QAction
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. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course