def hide_items_in_layout( layout: QtWidgets.QLayout ): """Hides all items within a Qt-layout """ for i in range(layout.count()): item = layout.itemAt(i) if type(item) == QtWidgets.QWidgetItem: item.widget().hide()
def get_widgets_in_layout( layout: QtWidgets.QLayout ): """Returns a list of all widgets within a layout """ return (layout.itemAt(i) for i in range(layout.count()))