In this article we will see how we can check if the QCalendarWidget is ancestor of the given widget or not. In order todo so we use
isAncestorOf method, this method returns true if the calendar is a parent, (or grandparent and so on to any level), of the given child, and both widgets are within the same window; otherwise returns false.
In order to do this we will use
isAncestorOfmethod with the QCalendarWidget object.
Syntax : calendar.isAncestorOf(query)
Argument : It takes QWidget object as argument
Return : It return bool
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.