PyQt5 QCalendarWidget – Setting Enter Event
In this article we will see how we can implement the enter event for the QCalendarWidget. A enter event is sent to the calendar when the mouse cursor enters the calendar. This event handler can be reimplemented in a subclass to receive calendar enter events which are passed in the event parameter.
Below is the Calendar class code
# QCalendarWidget Class class Calendar(QCalendarWidget): # constructor def __init__(self, parent=None): super(Calendar, self).__init__(parent) # overriding the enter event def enterEvent(self, event): # setting to the text to the label window.label.setText("Enter Event Take place")
1. Create a Calendar class that inherits the QCalendarWidget
2. Inside the Calendar class override the enterEvent and inside the event set the text to the label
3. Create a main window class
4. Create a Calendar object inside the main window
5. Set various properties to the calendar
Below is the implementation
My Personal Notes arrow_drop_up
Please Login to comment...