'Set the widget around which to show the shadow.'

def setWidget(self, widget):

    if self.__widget:
        self.__widget.removeEventFilter(self)
    self.__widget = widget
    if self.__widget:
        self.__widget.installEventFilter(self)
        parent = widget.parentWidget()
        while (not (isinstance(parent, (QAbstractScrollArea, QToolBar)) or parent.isWindow())):
            parent = parent.parentWidget()
        if isinstance(parent, QAbstractScrollArea):
            parent = parent.viewport()
        self.__widgetParent = parent
        self.setParent(parent)
        self.stackUnder(widget)
        self.__updateGeometry()
        self.setVisible(widget.isVisible())
