Calculate a global point position `QPoint(x, y)`, for a given
        line, local cursor position, or local point.

def _calculate_position(self, at_line=None, at_position=None,
                            at_point=None):
        """
        Calculate a global point position `QPoint(x, y)`, for a given
        line, local cursor position, or local point.
        """
        # Check that no option or only one option is given:
        if [at_line, at_position, at_point].count(None) < 2:
            raise Exception('Provide no argument or only one argument!')

        # Saving cursor position:
        if at_position is None:
            at_position = self.get_position('cursor')

        # FIXME: What id this used for?
        self.calltip_position = at_position

        if at_point is not None:
            # Showing tooltip at point position
            cx, cy = at_point.x(), at_point.y()
        elif at_line is not None:
            # Showing tooltip at line
            cx = 5
            cursor = QTextCursor(self.document().findBlockByNumber(at_line-1))
            cy = self.cursorRect(cursor).top()
        else:
            # Showing tooltip at cursor position
            # FIXME: why is at_position not being used to calculate the
            # coordinates?
            cx, cy = self.get_coordinates('cursor')

        # Calculate vertical delta
        font = self.font()
        delta = font.pointSize() + 5

        # Map to global coordinates
        point = self.mapToGlobal(QPoint(cx, cy))
        point = self.calculate_real_position(point)
        point.setY(point.y() + delta)

        return point