Class: QgsLayoutComboBox

class qgis.gui.QgsLayoutComboBox

Bases: PyQt5.QtWidgets.QComboBox

The QgsLayoutComboBox class is a combo box which displays available layouts from a QgsLayoutManager.

Added in version 3.8.

QgsLayoutComboBox(parent: Optional[QWidget] = None, manager: Optional[QgsLayoutManager] = None) QgsLayoutComboBox creates a combo box to display a list of items in a layout manager. The layouts can optionally be filtered by type.

Methods

actionEvent

allowEmptyLayout

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

changeEvent

childEvent

closeEvent

connectNotify

contextMenuEvent

create

currentLayout

Returns the layout currently selected in the combo box.

customEvent

destroy

disconnectNotify

dragEnterEvent

dragLeaveEvent

dragMoveEvent

dropEvent

enterEvent

filters

Returns the current filters used for filtering available layouts.

focusInEvent

focusNextChild

focusNextPrevChild

focusOutEvent

focusPreviousChild

hideEvent

initPainter

initStyleOption

inputMethodEvent

isSignalConnected

keyPressEvent

keyReleaseEvent

layout

Returns the layout at the specified index.

leaveEvent

metric

mouseDoubleClickEvent

mouseMoveEvent

mousePressEvent

mouseReleaseEvent

moveEvent

nativeEvent

paintEvent

receivers

resizeEvent

sender

senderSignalIndex

setAllowEmptyLayout

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

setCurrentLayout

Sets the currently selected layout in the combo box.

setFilters

Sets the current filters used for filtering available layouts.

setLayoutManager

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

sharedPainter

showEvent

tabletEvent

timerEvent

updateMicroFocus

wheelEvent

Signals

layoutChanged

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

actionEvent(self, a0: QActionEvent | None)
allowEmptyLayout(self) bool

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

Return type:

bool

changeEvent(self, e: QEvent | None)
childEvent(self, a0: QChildEvent | None)
closeEvent(self, a0: QCloseEvent | None)
connectNotify(self, signal: QMetaMethod)
contextMenuEvent(self, e: QContextMenuEvent | None)
create(self, window: PyQt5.sip.voidptr = None, initializeWindow: bool = True, destroyOldWindow: bool = True)
currentLayout(self) QgsMasterLayoutInterface | None

Returns the layout currently selected in the combo box.

Return type:

Optional[QgsMasterLayoutInterface]

customEvent(self, a0: QEvent | None)
destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
disconnectNotify(self, signal: QMetaMethod)
dragEnterEvent(self, a0: QDragEnterEvent | None)
dragLeaveEvent(self, a0: QDragLeaveEvent | None)
dragMoveEvent(self, a0: QDragMoveEvent | None)
dropEvent(self, a0: QDropEvent | None)
enterEvent(self, a0: QEvent | None)
filters(self) QgsLayoutManagerProxyModel.Filters

Returns the current filters used for filtering available layouts.

See also

setFilters()

Return type:

QgsLayoutManagerProxyModel.Filters

focusInEvent(self, e: QFocusEvent | None)
focusNextChild(self) bool
focusNextPrevChild(self, next: bool) bool
focusOutEvent(self, e: QFocusEvent | None)
focusPreviousChild(self) bool
hideEvent(self, e: QHideEvent | None)
initPainter(self, painter: QPainter | None)
initStyleOption(self, option: QStyleOptionComboBox | None)
inputMethodEvent(self, a0: QInputMethodEvent | None)
isSignalConnected(self, signal: QMetaMethod) bool
keyPressEvent(self, e: QKeyEvent | None)
keyReleaseEvent(self, e: QKeyEvent | None)
layout(self, index: int) QgsMasterLayoutInterface | None

Returns the layout at the specified index.

Parameters:

index (int)

Return type:

Optional[QgsMasterLayoutInterface]

layoutChanged

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.

Parameters:
  • name (str = ...)

  • revision (int = ...)

  • arguments (Sequence = ...)

Return type:

PYQT_SIGNAL

leaveEvent(self, a0: QEvent | None)
metric(self, a0: QPaintDevice.PaintDeviceMetric) int
mouseDoubleClickEvent(self, a0: QMouseEvent | None)
mouseMoveEvent(self, a0: QMouseEvent | None)
mousePressEvent(self, e: QMouseEvent | None)
mouseReleaseEvent(self, e: QMouseEvent | None)
moveEvent(self, a0: QMoveEvent | None)
nativeEvent(self, eventType: QByteArray | bytes | bytearray, message: PyQt5.sip.voidptr | None)
paintEvent(self, e: QPaintEvent | None)
receivers(self, signal: PYQT_SIGNAL) int
resizeEvent(self, e: QResizeEvent | None)
sender(self) QObject | None
senderSignalIndex(self) int
setAllowEmptyLayout(self, allowEmpty: bool)

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

Parameters:

allowEmpty (bool)

setCurrentLayout(self, layout: QgsMasterLayoutInterface | None)

Sets the currently selected layout in the combo box.

Parameters:

layout (Optional[QgsMasterLayoutInterface])

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

Sets the current filters used for filtering available layouts.

See also

filters()

Parameters:

filters (Union[QgsLayoutManagerProxyModel.Filters)

setLayoutManager(self, manager: QgsLayoutManager | None)

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

Parameters:

manager (Optional[QgsLayoutManager])

sharedPainter(self) QPainter | None
showEvent(self, e: QShowEvent | None)
tabletEvent(self, a0: QTabletEvent | None)
timerEvent(self, a0: QTimerEvent | None)
updateMicroFocus(self)
wheelEvent(self, e: QWheelEvent | None)