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.

Parameters
  • parent (QWidget = None) –

  • layout

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

Returns the item currently selected in the combo box.

Return type

QgsLayoutItem

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

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

Return type

List[QgsLayoutItem]

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()

Parameters

index (int) –

Return type

QgsLayoutItem

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()

Return type

QgsLayoutItemRegistry.ItemType

keyPressEvent()
keyReleaseEvent()
leaveEvent()
metric()
mouseDoubleClickEvent()
mouseMoveEvent()
mousePressEvent()
mouseReleaseEvent()
moveEvent()
nativeEvent()
paintEvent()
receivers()
resizeEvent()
sender()
senderSignalIndex()
setCurrentLayout(self, layout: QgsLayout)

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

Parameters

layout (QgsLayout) –

setExceptedItemList(self, exceptList: Iterable[QgsLayoutItem])

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

Parameters

exceptList (Iterable[QgsLayoutItem]) –

setItem(self, item: QgsLayoutItem)

Sets the currently selected item in the combo box.

Parameters

item (QgsLayoutItem) –

setItemType(self, itemType: QgsLayoutItemRegistry.ItemType)

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

Parameters

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

See also

itemType()

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