def get_rect_even_dimensions(rect_item, even_dimensions=True):
    """
    get the the graphics rectangle of the item, moved to position, with sides of even length
        Args:
            rect_item (QGraphicsRectItem)
            even_dimensions (bool): if False even dimensions are not enforced
        Returns
            (QRect): with even length sides
    """
    rect = rect_item.rect().toAlignedRect()
    pos = rect_item.pos().toPoint()
    rect.translate(pos)
    width = rect.width()
    height = rect.height()

    if not even_dimensions:
        return rect

    if width%2 == 1:
        rect.setWidth(width+1)

    if height%2 == 1:
        rect.setHeight(height+1)

    return rect