(self)
Update the widget position relative to the viewport.

        This is called whenever something happened with the view that caused
        this item to move from its anchored position, so we have to adjust the
        position to maintain the effect of being anchored.
Update the widget position relative to the viewport.
Update the widget position relative to the viewport .
def update_pos(self):
        """Update the widget position relative to the viewport.

        This is called whenever something happened with the view that caused
        this item to move from its anchored position, so we have to adjust the
        position to maintain the effect of being anchored."""
        view = self.__get_view()
        if self.__corner_str and view is not None:
            box = self.__usable_viewbox()
            corner = getattr(box, self.__corner_str)()
            new_pos = corner - self.__offset
            self.setPos(view.mapToScene(new_pos))
def update_pos ( self ) : view = self . __get_view ( ) if self . __corner_str and view is not None : box = self . __usable_viewbox ( ) corner = getattr ( box , self . __corner_str ) ( ) new_pos = corner - self . __offset self . setPos ( view . mapToScene ( new_pos ) )