Class: QgsLayoutItemComboBox

class qgis.gui.QgsLayoutItemComboBox(parent: QWidget = None, layout: QgsLayout = None)

Bases: PyQt5.QtWidgets.QComboBox

QgsLayoutItemComboBox creates a combo box to display a list of items in a layout. The items can optionally be filtered by type. If layout is not set, no items will be shown until setCurrentLayout() is called

The QgsLayoutItemComboBox class is a combo box which displays items of a matching type from a layout.

New in version 3.0: Enums

Methods

actionEvent

allowEmptyItem

Returns True if the model includes the empty item choice.

changeEvent

childEvent

closeEvent

connectNotify

contextMenuEvent

create

currentItem

Returns the item currently selected in the combo box.

currentLayout

Returns the current layout containing the items shown in the combo box.

customEvent

destroy

disconnectNotify

dragEnterEvent

dragLeaveEvent

dragMoveEvent

dropEvent

enterEvent

exceptedItemList

Returns the list of specific items excluded from the combo box.

focusInEvent

focusNextChild

focusNextPrevChild

focusOutEvent

focusPreviousChild

hideEvent

initPainter

initStyleOption

inputMethodEvent

isSignalConnected

item

Returns the item currently shown at the specified index within the combo box.

itemType

Returns the filter for the item types to show in the combo box.

keyPressEvent

keyReleaseEvent

leaveEvent

metric

mouseDoubleClickEvent

mouseMoveEvent

mousePressEvent

mouseReleaseEvent

moveEvent

nativeEvent

paintEvent

receivers

resizeEvent

sender

senderSignalIndex

setAllowEmptyItem

Sets whether an optional empty layout item is present in the combobox.

setCurrentLayout

Sets the layout containing the items to list in the combo box.

setExceptedItemList

Sets a list of specific items to exclude from the combo box.

setItem

Sets the currently selected item in the combo box.

setItemType

Sets a filter for the item type to show in the combo box.

sharedPainter

showEvent

tabletEvent

timerEvent

updateMicroFocus

wheelEvent

Signals

itemChanged

Emitted whenever the currently selected item changes [signal]

Attributes

actionEvent()
allowEmptyItem(self) → bool

Returns True if the model includes the empty item choice.

New in version 3.8.

changeEvent()
childEvent()
closeEvent()
connectNotify()
contextMenuEvent()
create()
currentItem(self) → QgsLayoutItem

Returns the item currently selected in the combo box.

currentLayout(self) → QgsLayout

Returns the current layout containing the items shown in the combo box.

customEvent()
destroy()
disconnectNotify()
dragEnterEvent()
dragLeaveEvent()
dragMoveEvent()
dropEvent()
enterEvent()
exceptedItemList(self) → List[QgsLayoutItem]

Returns the list of specific items excluded from the combo box.

focusInEvent()
focusNextChild()
focusNextPrevChild()
focusOutEvent()
focusPreviousChild()
hideEvent()
initPainter()
initStyleOption()
inputMethodEvent()
isSignalConnected()
item(self, index: int) → QgsLayoutItem

Returns the item currently shown at the specified index within the combo box.

See also

currentItem()

itemChanged

Emitted whenever the currently selected item changes [signal]

itemType(self) → QgsLayoutItemRegistry.ItemType

Returns the filter for the item types to show in the combo box.

See also

setItemType()

keyPressEvent()
keyReleaseEvent()
leaveEvent()
metric()
mouseDoubleClickEvent()
mouseMoveEvent()
mousePressEvent()
mouseReleaseEvent()
moveEvent()
nativeEvent()
paintEvent()
receivers()
resizeEvent()
sender()
senderSignalIndex()
setAllowEmptyItem(self, allowEmpty: bool)

Sets whether an optional empty layout item is present in the combobox.

See also

allowEmptyItem()

New in version 3.8.

setCurrentLayout(self, layout: QgsLayout)

Sets the layout containing the items to list in the combo box.

See also

currentLayout()

setExceptedItemList(self, exceptList: Iterable[QgsLayoutItem])

Sets a list of specific items to exclude from the combo box.

setItem(self, item: QgsLayoutItem)

Sets the currently selected item in the combo box.

setItemType(self, itemType: QgsLayoutItemRegistry.ItemType)

Sets a filter for the item type to show in the combo box.

Parameters

itemType – type of items to show. Set to QgsLayoutItemRegistry.LayoutItem to show all items.

See also

itemType()

sharedPainter()
showEvent()
tabletEvent()
timerEvent()
updateMicroFocus()
wheelEvent()