(layout: QGraphicsGridLayout, row: int)
Return the geometry of the `row` in the grid layout.

    If the row is empty return an empty geometry
Return the geometry of the `row` in the grid layout.
Return the geometry of the row in the grid layout .
def grid_layout_row_geometry(layout: QGraphicsGridLayout, row: int) -> QRectF:
    """
    Return the geometry of the `row` in the grid layout.

    If the row is empty return an empty geometry
    """
    if not 0 <= row < layout.rowCount():
        return QRectF()

    columns = layout.columnCount()
    geometries: List[QRectF] = []
    for item in (layout.itemAt(row, column) for column in range(columns)):
        if item is not None:
            itemgeom = item.geometry()
            if itemgeom.isValid():
                geometries.append(itemgeom)
    if geometries:
        rect = layout.geometry()
        rect.setTop(min(g.top() for g in geometries))
        rect.setBottom(max(g.bottom() for g in geometries))
        return rect
    else:
        return QRectF()
def grid_layout_row_geometry ( layout : QGraphicsGridLayout , row : int ) -> QRectF : if not 0 <= row < layout . rowCount ( ) : return QRectF ( ) columns = layout . columnCount ( ) geometries : List [ QRectF ] = [ ] for item in ( layout . itemAt ( row , column ) for column in range ( columns ) ) : if item is not None : itemgeom = item . geometry ( ) if itemgeom . isValid ( ) : geometries . append ( itemgeom ) if geometries : rect = layout . geometry ( ) rect . setTop ( min ( g . top ( ) for g in geometries ) ) rect . setBottom ( max ( g . bottom ( ) for g in geometries ) ) return rect else : return QRectF ( )