In this article we will see how we can set background color to the QCalendarWidget, setting background color to QCalendarWidget is not like setting border to the other widgets, calendar is widget which has many child i.e component we can set background color to independent component as well. Below is how the calendar with background color will look like
In order to do this we will use
setStyleSheet method with the QCalendarWidget object, below is the style sheet code
background-color : lightgreen;
Note : This will remove all the previous style sheet of the calendar
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.