code: def eventFilter(self, object, event):
          
          if object == self.parent() and event.type() == QtCore.QEvent.Resize:
              self.resize(event.size())
          elif event.type() == QtCore.QEvent.Close:
              self.setResult(0)
          return False
docs: Resizes this overlay as the widget resizes.
  
          :param      object | <QtCore.QObject>
                      event  | <QtCore.QEvent>
  
          :return     <bool>