Class: QgsLayoutItemComboBox¶
- class qgis.gui.QgsLayoutItemComboBox¶
Bases:
PyQt5.QtWidgets.QComboBox
The
QgsLayoutItemComboBox
class is a combo box which displays items of a matching type from a layout.New in version 3.0.
QgsLayoutItemComboBox(parent: QWidget = None, layout:
QgsLayout
= None)QgsLayoutItemComboBox
creates a combo box to display a list of items in alayout
. The items can optionally be filtered by type. Iflayout
is not set, no items will be shown untilsetCurrentLayout()
is calledMethods
Returns
True
if the model includes the empty item choice.Returns the item currently selected in the combo box.
Returns the current layout containing the items shown in the combo box.
Returns the list of specific items excluded from the combo box.
Returns the item currently shown at the specified
index
within the combo box.Returns the layout item flags used for filtering the available items.
Returns the filter for the item types to show in the combo box.
Sets whether an optional empty layout item is present in the combobox.
Sets the
layout
containing the items to list in the combo box.Sets a list of specific items to exclude from the combo box.
Sets the currently selected
item
in the combo box.Sets layout item flags to use for filtering the available items.
Sets a filter for the item type to show in the combo box.
Signals
Emitted whenever the currently selected item changes [signal]
- actionEvent(self, QActionEvent)¶
- allowEmptyItem(self) bool ¶
Returns
True
if the model includes the empty item choice.See also
New in version 3.8.
- Return type
bool
- changeEvent(self, QEvent)¶
- childEvent(self, QChildEvent)¶
- closeEvent(self, QCloseEvent)¶
- connectNotify(self, QMetaMethod)¶
- contextMenuEvent(self, QContextMenuEvent)¶
- create(self, window: sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)¶
- currentItem(self) QgsLayoutItem ¶
Returns the item currently selected in the combo box.
- Return type
- currentLayout(self) QgsLayout ¶
Returns the current layout containing the items shown in the combo box.
See also
- Return type
- customEvent(self, QEvent)¶
- destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)¶
- disconnectNotify(self, QMetaMethod)¶
- dragEnterEvent(self, QDragEnterEvent)¶
- dragLeaveEvent(self, QDragLeaveEvent)¶
- dragMoveEvent(self, QDragMoveEvent)¶
- dropEvent(self, QDropEvent)¶
- enterEvent(self, QEvent)¶
- exceptedItemList(self) List[QgsLayoutItem] ¶
Returns the list of specific items excluded from the combo box.
See also
- Return type
List[QgsLayoutItem]
- focusInEvent(self, QFocusEvent)¶
- focusNextChild(self) bool ¶
- focusNextPrevChild(self, bool) bool ¶
- focusOutEvent(self, QFocusEvent)¶
- focusPreviousChild(self) bool ¶
- hideEvent(self, QHideEvent)¶
- initPainter(self, QPainter)¶
- initStyleOption(self, QStyleOptionComboBox)¶
- inputMethodEvent(self, QInputMethodEvent)¶
- isSignalConnected(self, QMetaMethod) bool ¶
- item(self, index: int) QgsLayoutItem ¶
Returns the item currently shown at the specified
index
within the combo box.See also
- Parameters
index (int) –
- Return type
- itemChanged¶
Emitted whenever the currently selected item changes [signal]
- Parameters
item (QgsLayoutItem) –
- itemFlags(self) QgsLayoutItem.Flags ¶
Returns the layout item flags used for filtering the available items.
Returns
None
if no flag based filtering is occurring.See also
New in version 3.16.
- Return type
- itemType(self) QgsLayoutItemRegistry.ItemType ¶
Returns the filter for the item types to show in the combo box.
See also
- Return type
- keyPressEvent(self, QKeyEvent)¶
- keyReleaseEvent(self, QKeyEvent)¶
- leaveEvent(self, QEvent)¶
- metric(self, QPaintDevice.PaintDeviceMetric) int ¶
- mouseDoubleClickEvent(self, QMouseEvent)¶
- mouseMoveEvent(self, QMouseEvent)¶
- mousePressEvent(self, QMouseEvent)¶
- mouseReleaseEvent(self, QMouseEvent)¶
- moveEvent(self, QMoveEvent)¶
- nativeEvent(self, Union[QByteArray, bytes, bytearray], sip.voidptr) Tuple[bool, int] ¶
- paintEvent(self, QPaintEvent)¶
- receivers(self, PYQT_SIGNAL) int ¶
- resizeEvent(self, QResizeEvent)¶
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setAllowEmptyItem(self, allowEmpty: bool)¶
Sets whether an optional empty layout item is present in the combobox.
See also
New in version 3.8.
- Parameters
allowEmpty (bool) –
- setCurrentLayout(self, layout: QgsLayout)¶
Sets the
layout
containing the items to list in the combo box.See also
- Parameters
layout (QgsLayout) –
- setExceptedItemList(self, exceptList: Iterable[QgsLayoutItem])¶
Sets a list of specific items to exclude from the combo box.
See also
- Parameters
exceptList (Iterable[QgsLayoutItem]) –
- setItem(self, item: QgsLayoutItem)¶
Sets the currently selected
item
in the combo box.- Parameters
item (QgsLayoutItem) –
- setItemFlags(self, flags: Union[QgsLayoutItem.Flags, QgsLayoutItem.Flag])¶
Sets layout item flags to use for filtering the available items.
Set
flags
toNone
to clear the flag based filtering.See also
New in version 3.16.
- Parameters
flags (Union[QgsLayoutItem.Flags) –
- 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
- showEvent(self, QShowEvent)¶
- tabletEvent(self, QTabletEvent)¶
- timerEvent(self, QTimerEvent)¶
- updateMicroFocus(self)¶
- wheelEvent(self, QWheelEvent)¶