VOOZH about

URL: https://www.geeksforgeeks.org/python/pyqt5-qcalendarwidget-background-color-to-the-months-menu/

⇱ PyQt5 QCalendarWidget - Background Color to the months menu - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

PyQt5 QCalendarWidget - Background Color to the months menu

Last Updated : 21 Jun, 2020
In this article we will see how we can set background color to the months menu of the QCalendarWidget. Month menu is the QMenu object child of calendar, it appear when user press on the month name so that user can select the month, setting background color to QCalendarWidget is not like setting background color 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 on month menu will look like 👁 Image
In order to do this we will use setStyleSheet method with the QCalendarWidget object, below is the style sheet code
QCalendarWidget QMenu
{
background-color : lightgreen;
}
Below is the implementation Output : 👁 Image
Comment