In this article we will see how we can get date text format to the specific date in the QCalendarWidget. Setting date text format makes the specified date looks more special such as increasing the size and other features. Below is how date with date text format looks like.
In order to do this we will use
dateTextFormatmethod with the QCalendarWidget object.
Syntax : calendar.dateTextFormat()
Argument : It takes no argument
Return : It return dictionary where keys are QDate object and values are QTextCharFormat object
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