(layout)
return layout
Return a widget or convert a layout to a widget.
Return a widget or convert a layout to a widget.
Return a widget or convert a layout to a widget .
def layoutToWidget(layout):
    """Return a widget or convert a layout to a widget."""
    if isinstance(layout, QtBase):
        layout = layout.QObject
    if isinstance(layout, QtWidgets.QLayout):
        new = QtWidgets.QWidget()
        new.setLayout(layout)
        return new
    return layout
def layoutToWidget ( layout ) : if isinstance ( layout , QtBase ) : layout = layout . QObject if isinstance ( layout , QtWidgets . QLayout ) : new = QtWidgets . QWidget ( ) new . setLayout ( layout ) return new return layout