code: def showEvent(self, event):
          
          super(XOverlayWidget, self).showEvent(event)
  
          # raise to the top
          self.raise_()
          self._closeButton.setVisible(self.isClosable())
  
          widget = self.centralWidget()
          if widget:
              center = self.rect().center()
              start_x = end_x = center.x() - widget.width() / 2
              start_y = -widget.height()
              end_y = center.y() - widget.height() / 2
  
              start = QtCore.QPoint(start_x, start_y)
              end = QtCore.QPoint(end_x,  end_y)
  
              # create the movement animation
              anim = QtCore.QPropertyAnimation(self)
              anim.setPropertyName('pos')
              anim.setTargetObject(widget)
              anim.setStartValue(start)
              anim.setEndValue(end)
              anim.setDuration(500)
              anim.setEasingCurve(QtCore.QEasingCurve.InOutQuad)
              anim.finished.connect(anim.deleteLater)
              anim.start()
docs: Ensures this widget is the top-most widget for its parent.
  
          :param      event | <QtCore.QEvent>