'Update the shadow geometry to fit the widget\'s changed
geometry.'

def __updateGeometry(self):

    widget = self.__widget
    parent = self.__widgetParent
    radius = self.radius_
    pos = widget.pos()
    if (parent != widget.parentWidget()):
        pos = widget.parentWidget().mapTo(parent, pos)
    geom = QRect(pos, widget.size())
    geom.adjust((- radius), (- radius), radius, radius)
    if (geom != self.geometry()):
        self.setGeometry(geom)
    rect = self.rect()
    mask = QRegion(rect)
    transparent = QRegion(rect.adjusted(radius, radius, (- radius), (- radius)))
    mask = mask.subtracted(transparent)
    self.setMask(mask)
