In this article we will see how we can set the date range to the QCalendarWidget. The date range of QCalendarWidget restricts the user selection, i.e. the user can only select dates within the specified date range. Rest of the dates get disabled.
In order to do this we will use
setDateRangemethod with the QCalendarWidget object.
Syntax : calender.setDateRange(lower_date, upper_date)
Argument : It takes two QDate object 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.