(self, offset)
Take the offset specified in the constructor and calculate the
        actual offset from the top left corner of the item so positioning can
        be done correctly.
Take the offset specified in the constructor and calculate the
        actual offset from the top left corner of the item so positioning can
        be done correctly.
Take the offset specified in the constructor and calculate the actual offset from the top left corner of the item so positioning can be done correctly .
def __calculate_actual_offset(self, offset):
        """Take the offset specified in the constructor and calculate the
        actual offset from the top left corner of the item so positioning can
        be done correctly."""
        off_x, off_y = offset.x(), offset.y()
        width = self.boundingRect().width()
        height = self.boundingRect().height()

        if self.__corner_str == self.TOP_LEFT:
            return QPoint(-off_x, -off_y)
        elif self.__corner_str == self.TOP_RIGHT:
            return QPoint(off_x + width, -off_y)
        elif self.__corner_str == self.BOTTOM_RIGHT:
            return QPoint(off_x + width, off_y + height)
        elif self.__corner_str == self.BOTTOM_LEFT:
            return QPoint(-off_x, off_y + height)
def __calculate_actual_offset ( self , offset ) : off_x , off_y = offset . x ( ) , offset . y ( ) width = self . boundingRect ( ) . width ( ) height = self . boundingRect ( ) . height ( ) if self . __corner_str == self . TOP_LEFT : return QPoint ( - off_x , - off_y ) elif self . __corner_str == self . TOP_RIGHT : return QPoint ( off_x + width , - off_y ) elif self . __corner_str == self . BOTTOM_RIGHT : return QPoint ( off_x + width , off_y + height ) elif self . __corner_str == self . BOTTOM_LEFT : return QPoint ( - off_x , off_y + height )