Class: QgsLayoutComboBox¶
The QgsLayoutComboBox
class is a combo box which displays
available layouts from a QgsLayoutManager
.
Added in version 3.8.

QgsLayoutComboBox in the collapsed state¶

QgsLayoutComboBox in the expanded state¶
Class Hierarchy¶
Base classes¶
Methods
Returns |
|
Returns the layout currently selected in the combo box. |
|
Returns the current filters used for filtering available layouts. |
|
Returns the layout at the specified index. |
|
Sets whether an optional empty layout ("not set") option is present in the combobox. |
|
Sets the currently selected layout in the combo box. |
|
Sets the current filters used for filtering available layouts. |
|
Sets the layout manager containing the layouts to list in the combo box. |
Signals
Emitted whenever the currently selected layout changes |
- 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:
parent (Optional[QWidget] = None)
manager (Optional[QgsLayoutManager] = None)
- allowEmptyLayout(self) bool [source]¶
Returns
True
if the combobox includes the empty layout (“not set”) choice.See also
- 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
- Return type:
- layout(self, index: int) QgsMasterLayoutInterface | None [source]¶
Returns the layout at the specified
index
.- Parameters:
index (int)
- Return type:
Optional[QgsMasterLayoutInterface]
- signal layoutChanged(layout: QgsMasterLayoutInterface)[source]¶
Emitted whenever the currently selected layout changes
- Parameters:
layout (QgsMasterLayoutInterface)
- setAllowEmptyLayout(self, allowEmpty: bool)[source]¶
Sets whether an optional empty layout (“not set”) option is present in the combobox.
See also
- 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
- 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])