Class: QgsLayoutComboBox

A combobox which displays available layouts from a QgsLayoutManager.

Added in version 3.8.

QgsLayoutComboBox in the collapsed state

QgsLayoutComboBox in the collapsed state

QgsLayoutComboBox in the expanded state

QgsLayoutComboBox in the expanded state

Class Hierarchy

Inheritance diagram of qgis.gui.QgsLayoutComboBox

Base classes

QComboBox

QWidget

QObject

QPaintDevice

class qgis.gui.QgsLayoutComboBox[source]

Bases: QComboBox

__init__(parent: QWidget | None = None, manager: QgsLayoutManager | None = None)

QgsLayoutComboBox creates a combo box to display a list of items in a layout manager. The layouts can optionally be filtered by type.

Parameters:
allowEmptyLayout(self) bool[source]

Returns True if the combobox includes the empty layout (“not set”) choice.

Return type:

bool

currentLayout(self) QgsMasterLayoutInterface | None[source]

Returns the layout currently selected in the combo box.

Return type:

Optional[QgsMasterLayoutInterface]

filters(self) QgsLayoutManagerProxyModel.Filters[source]

Returns the current filters used for filtering available layouts.

See also

setFilters()

Return type:

QgsLayoutManagerProxyModel.Filters

layout(self, index: int) QgsMasterLayoutInterface | None[source]

Returns the layout at the specified index.

Parameters:

index (int)

Return type:

Optional[QgsMasterLayoutInterface]

signal layoutChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

setAllowEmptyLayout(self, allowEmpty: bool)[source]

Sets whether an optional empty layout (“not set”) option is present in the combobox.

Parameters:

allowEmpty (bool)

setCurrentLayout(self, layout: QgsMasterLayoutInterface | None)[source]

Sets the currently selected layout in the combo box.

Parameters:

layout (Optional[QgsMasterLayoutInterface])

setFilters(self, filters: QgsLayoutManagerProxyModel.Filters | QgsLayoutManagerProxyModel.Filter)[source]

Sets the current filters used for filtering available layouts.

See also

filters()

Parameters:

filters (Union[QgsLayoutManagerProxyModel.Filters, QgsLayoutManagerProxyModel.Filter])

setLayoutManager(self, manager: QgsLayoutManager | None)[source]

Sets the layout manager containing the layouts to list in the combo box.

Parameters:

manager (Optional[QgsLayoutManager])