Class: QgsFeatureListComboBox

class qgis.gui.QgsFeatureListComboBox

Bases: PyQt5.QtWidgets.QComboBox

This offers a combobox with autocompleter that allows selecting features from a layer.

It will show up to 100 entries at a time. The entries can be chosen based on the displayExpression and whenever text is typed into the combobox, the completer and popup will adjust to features matching the typed text.

New in version 3.0.

QgsFeatureListComboBox(parent: QWidget = None) Create a new QgsFeatureListComboBox, optionally specifying a parent.

Methods

actionEvent

allowNull

Determines if a NULL value should be available in the list.

changeEvent

childEvent

closeEvent

connectNotify

contextMenuEvent

create

currentFeatureRequest

Shorthand for getting a feature request to query the currently selected feature.

currentModelIndex

The index of the currently selected item.

customEvent

destroy

disconnectNotify

displayExpression

The display expression will be used to display features as well as the value to match the typed text against.

dragEnterEvent

dragLeaveEvent

dragMoveEvent

dropEvent

enterEvent

filterExpression

An additional expression to further restrict the available features.

focusInEvent

focusNextChild

focusNextPrevChild

focusOutEvent

param event:

focusPreviousChild

hideEvent

identifierField

Field name that will be used to uniquely identify the current feature.

identifierFields

Field name that will be used to uniquely identify the current feature.

identifierValue

The identifier value of the currently selected feature.

identifierValues

The identifier values of the currently selected feature.

initPainter

initStyleOption

inputMethodEvent

isSignalConnected

keyPressEvent

param event:

keyReleaseEvent

leaveEvent

metric

mouseDoubleClickEvent

mouseMoveEvent

mousePressEvent

mouseReleaseEvent

moveEvent

nativeEvent

nullIndex

Returns the current index of the NULL value, or -1 if NULL values are not allowed.

paintEvent

receivers

resizeEvent

sender

senderSignalIndex

setAllowNull

Determines if a NULL value should be available in the list.

setCurrentFeature

Sets the current index by using the given feature

setDisplayExpression

The display expression will be used to display features as well as the value to match the typed text against.

setFilterExpression

An additional expression to further restrict the available features.

setIdentifierField

Field name that will be used to uniquely identify the current feature.

setIdentifierFields

Field name that will be used to uniquely identify the current feature.

setIdentifierValue

The identifier value of the currently selected feature.

setIdentifierValues

The identifier values of the currently selected feature.

setIdentifierValuesToNull

Sets the identifier values of the currently selected feature to NULL value(s).

setSourceLayer

The layer from which features should be listed.

sharedPainter

showEvent

sourceLayer

The layer from which features should be listed.

tabletEvent

timerEvent

updateMicroFocus

wheelEvent

Signals

allowNullChanged

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

currentFeatureChanged

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

displayExpressionChanged

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

filterExpressionChanged

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

identifierFieldChanged

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

identifierValueChanged

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

modelUpdated

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

sourceLayerChanged

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

actionEvent(self, QActionEvent)
allowNull(self) bool

Determines if a NULL value should be available in the list.

Return type:

bool

allowNullChanged

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

changeEvent(self, QEvent)
childEvent(self, QChildEvent)
closeEvent(self, QCloseEvent)
connectNotify(self, QMetaMethod)
contextMenuEvent(self, QContextMenuEvent)
create(self, window: PyQt5.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)
currentFeatureChanged

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

currentFeatureRequest(self) QgsFeatureRequest

Shorthand for getting a feature request to query the currently selected feature.

Return type:

QgsFeatureRequest

currentModelIndex(self) QModelIndex

The index of the currently selected item.

Return type:

QModelIndex

customEvent(self, QEvent)
destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
disconnectNotify(self, QMetaMethod)
displayExpression(self) str

The display expression will be used to display features as well as the value to match the typed text against.

Return type:

str

displayExpressionChanged

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

dragEnterEvent(self, QDragEnterEvent)
dragLeaveEvent(self, QDragLeaveEvent)
dragMoveEvent(self, QDragMoveEvent)
dropEvent(self, QDropEvent)
enterEvent(self, QEvent)
filterExpression(self) str

An additional expression to further restrict the available features. This can be used to integrate additional spatial or other constraints.

Return type:

str

filterExpressionChanged

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

focusInEvent(self, QFocusEvent)
focusNextChild(self) bool
focusNextPrevChild(self, bool) bool
focusOutEvent(self, event: QFocusEvent)
Parameters:

event (QFocusEvent) –

focusPreviousChild(self) bool
hideEvent(self, QHideEvent)
identifierField(self) str

Field name that will be used to uniquely identify the current feature. Normally the primary key of the layer.

Deprecated since version QGIS: 3.10

Return type:

str

identifierFieldChanged

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

identifierFields(self) List[str]

Field name that will be used to uniquely identify the current feature. Normally the primary key of the layer.

New in version 3.10.

Return type:

List[str]

identifierValue(self) Any

The identifier value of the currently selected feature. A value from the identifierField.

Deprecated since version QGIS: 3.10

Return type:

Any

identifierValueChanged

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

identifierValues(self) List[Any]

The identifier values of the currently selected feature. A value from the identifierField.

New in version 3.10.

Return type:

List[Any]

initPainter(self, QPainter)
initStyleOption(self, QStyleOptionComboBox)
inputMethodEvent(self, QInputMethodEvent)
isSignalConnected(self, QMetaMethod) bool
keyPressEvent(self, event: QKeyEvent)
Parameters:

event (QKeyEvent) –

keyReleaseEvent(self, QKeyEvent)
leaveEvent(self, QEvent)
metric(self, QPaintDevice.PaintDeviceMetric) int
modelUpdated

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

mouseDoubleClickEvent(self, QMouseEvent)
mouseMoveEvent(self, QMouseEvent)
mousePressEvent(self, QMouseEvent)
mouseReleaseEvent(self, QMouseEvent)
moveEvent(self, QMoveEvent)
nativeEvent(self, Union[QByteArray, bytes, bytearray], PyQt5.sip.voidptr) Tuple[bool, int]
nullIndex(self) int

Returns the current index of the NULL value, or -1 if NULL values are not allowed.

New in version 3.2.

Return type:

int

paintEvent(self, QPaintEvent)
receivers(self, PYQT_SIGNAL) int
resizeEvent(self, QResizeEvent)
sender(self) QObject
senderSignalIndex(self) int
setAllowNull(self, allowNull: bool)

Determines if a NULL value should be available in the list.

Parameters:

allowNull (bool) –

setCurrentFeature(self, feature: QgsFeature)

Sets the current index by using the given feature

New in version 3.10.

Parameters:

feature (QgsFeature) –

setDisplayExpression(self, displayExpression: str)

The display expression will be used to display features as well as the value to match the typed text against.

Parameters:

displayExpression (str) –

setFilterExpression(self, filterExpression: str)

An additional expression to further restrict the available features. This can be used to integrate additional spatial or other constraints.

Parameters:

filterExpression (str) –

setIdentifierField(self, identifierField: str)

Field name that will be used to uniquely identify the current feature. Normally the primary key of the layer.

Deprecated since version QGIS: 3.10

Parameters:

identifierField (str) –

setIdentifierFields(self, identifierFields: Iterable[str])

Field name that will be used to uniquely identify the current feature. Normally the primary key of the layer.

New in version 3.10.

Parameters:

identifierFields (Iterable[str]) –

setIdentifierValue(self, identifierValue: Any)

The identifier value of the currently selected feature. A value from the identifierField.

Deprecated since version QGIS: 3.10 use setIdentifierValues

Parameters:

identifierValue (Any) –

setIdentifierValues(self, identifierValues: Iterable[Any])

The identifier values of the currently selected feature. A value from the identifierFields.

New in version 3.10.

Parameters:

identifierValues (Iterable[Any]) –

setIdentifierValuesToNull(self)

Sets the identifier values of the currently selected feature to NULL value(s).

New in version 3.10.

setSourceLayer(self, sourceLayer: QgsVectorLayer)

The layer from which features should be listed.

Parameters:

sourceLayer (QgsVectorLayer) –

sharedPainter(self) QPainter
showEvent(self, QShowEvent)
sourceLayer(self) QgsVectorLayer

The layer from which features should be listed.

Return type:

QgsVectorLayer

sourceLayerChanged

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

tabletEvent(self, QTabletEvent)
timerEvent(self, QTimerEvent)
updateMicroFocus(self)
wheelEvent(self, QWheelEvent)