(rect: QRectF)
return QRect(xmin, ymin, max(xmax - xmin, 0), max(ymax - ymin, 0))
Return the largest integer QRect such that it is completely contained in
    `rect`.
Return the largest integer QRect such that it is completely contained in
    `rect`.
Return the largest integer QRect such that it is completely contained in rect .
def qrectf_to_inscribed_rect(rect: QRectF) -> QRect:
    """
    Return the largest integer QRect such that it is completely contained in
    `rect`.
    """
    xmin = int(math.ceil(rect.x()))
    xmax = int(math.floor(rect.right()))
    ymin = int(math.ceil(rect.top()))
    ymax = int(math.floor(rect.bottom()))
    return QRect(xmin, ymin, max(xmax - xmin, 0), max(ymax - ymin, 0))
def qrectf_to_inscribed_rect ( rect : QRectF ) -> QRect : xmin = int ( math . ceil ( rect . x ( ) ) ) xmax = int ( math . floor ( rect . right ( ) ) ) ymin = int ( math . ceil ( rect . top ( ) ) ) ymax = int ( math . floor ( rect . bottom ( ) ) ) return QRect ( xmin , ymin , max ( xmax - xmin , 0 ) , max ( ymax - ymin , 0 ) )