PyQt5 QCalendarWidget – Getting Content Rectangle
In this article we will see how we can get the content rectangle to the QCalendarWidget. Content rectangle is the bounding rectangle of the content, by default content margin value is zero, so content rectangle is equal to the actual bounding rectangle but when margin change it become smaller as content rectangle is the rectangle excluding the margins. We can add margin with the help of setContentsMargins method.
In order to do this we will use contentsRect method with the QCalendarWidget object.
Syntax : calendar.contentsRect()
Argument : It takes no argument
Return : It return QRect object
Below is the implementation