PyQt5 QCalendarWidget – Setting Mask
In this article we will see how we can set the mask to the QCalendarWidget. Mask are basically used to hide the calendar, with the help of mask user will not be able to see the whole calendar although the calendar will still exist but there will be mask on it.
It causes only the pixels of the calendar for which bitmap has a corresponding 1 bit to be visible. If the region includes pixels outside the rectangle of the calendar, window system controls in that area may or may not be visible, depending on the platform.
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
In order to do this we will use
setMaskmethod with the QCalendarWidget object.
Syntax : calendar.setMask(region)
Argument : It takes QRegion object or QBitMap object as argument
Return : It return None
Below is the implementation