Class: QgsFeaturePickerWidget

class qgis.gui.QgsFeaturePickerWidget

Bases: PyQt5.QtWidgets.QWidget

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.

Added in version 3.14.

QgsFeaturePickerWidget(parent: Optional[QWidget] = None) Create a new QgsFeaturePickerWidget, optionally specifying a parent.

Methods

actionEvent

allowNull

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

changeEvent

childEvent

closeEvent

connectNotify

contextMenuEvent

create

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

event

feature

Returns the current feature

fetchGeometry

Returns if the geometry is fetched

fetchLimit

Returns the feature request fetch limit

filterExpression

An additional expression to further restrict the available features.

focusInEvent

focusNextChild

focusNextPrevChild

focusOutEvent

param event:

focusPreviousChild

hideEvent

initPainter

inputMethodEvent

isSignalConnected

keyPressEvent

param event:

keyReleaseEvent

layer

The layer from which features should be listed.

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.

setDisplayExpression

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

setFeature

Sets the current index by using the given feature

setFetchGeometry

Defines if the geometry will be fetched

setFetchLimit

Defines the feature request fetch limit If set to 0, no limit is applied when fetching

setFilterExpression

An additional expression to further restrict the available features.

setLayer

The layer from which features should be listed.

setShowBrowserButtons

Defines if the browsing buttons are shown

sharedPainter

showBrowserButtons

Returns if the browsing buttons are shown

showEvent

tabletEvent

timerEvent

updateMicroFocus

wheelEvent

Signals

allowNullChanged

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

displayExpressionChanged

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

featureChanged

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

fetchGeometryChanged

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

fetchLimitChanged

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

filterExpressionChanged

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

layerChanged

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

modelUpdated

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

showBrowserButtonsChanged

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

actionEvent(self, a0: QActionEvent | None)
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, a0: QEvent | None)
childEvent(self, a0: QChildEvent | None)
closeEvent(self, a0: QCloseEvent | None)
connectNotify(self, signal: QMetaMethod)
contextMenuEvent(self, a0: QContextMenuEvent | None)
create(self, window: PyQt5.sip.voidptr = None, initializeWindow: bool = True, destroyOldWindow: bool = True)
currentModelIndex(self) QModelIndex

The index of the currently selected item.

Return type:

QModelIndex

customEvent(self, a0: QEvent | None)
destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
disconnectNotify(self, signal: 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, a0: QDragEnterEvent | None)
dragLeaveEvent(self, a0: QDragLeaveEvent | None)
dragMoveEvent(self, a0: QDragMoveEvent | None)
dropEvent(self, a0: QDropEvent | None)
enterEvent(self, a0: QEvent | None)
event(self, a0: QEvent | None) bool
feature(self) QgsFeature

Returns the current feature

Return type:

QgsFeature

featureChanged

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

fetchGeometry(self) bool

Returns if the geometry is fetched

Return type:

bool

fetchGeometryChanged

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

fetchLimit(self) int

Returns the feature request fetch limit

Return type:

int

fetchLimitChanged

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

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, a0: QFocusEvent | None)
focusNextChild(self) bool
focusNextPrevChild(self, next: bool) bool
focusOutEvent(self, event: QFocusEvent | None)
Parameters:

event (Optional[QFocusEvent])

focusPreviousChild(self) bool
hideEvent(self, a0: QHideEvent | None)
initPainter(self, painter: QPainter | None)
inputMethodEvent(self, a0: QInputMethodEvent | None)
isSignalConnected(self, signal: QMetaMethod) bool
keyPressEvent(self, event: QKeyEvent | None)
Parameters:

event (Optional[QKeyEvent])

keyReleaseEvent(self, a0: QKeyEvent | None)
layer(self) QgsVectorLayer | None

The layer from which features should be listed.

Return type:

Optional[QgsVectorLayer]

layerChanged

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
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, a0: QMouseEvent | None)
mouseMoveEvent(self, a0: QMouseEvent | None)
mousePressEvent(self, a0: QMouseEvent | None)
mouseReleaseEvent(self, a0: QMouseEvent | None)
moveEvent(self, a0: QMoveEvent | None)
nativeEvent(self, eventType: QByteArray | bytes | bytearray, message: PyQt5.sip.voidptr | None)
nullIndex(self) int

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

Return type:

int

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

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

Parameters:

allowNull (bool)

setDisplayExpression(self, displayExpression: str | None)

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

Parameters:

displayExpression (Optional[str])

setFeature(self, featureId: int)

Sets the current index by using the given feature

Parameters:

featureId (int)

setFetchGeometry(self, fetchGeometry: bool)

Defines if the geometry will be fetched

Parameters:

fetchGeometry (bool)

setFetchLimit(self, fetchLimit: int)

Defines the feature request fetch limit If set to 0, no limit is applied when fetching

Parameters:

fetchLimit (int)

setFilterExpression(self, filterExpression: str | None)

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

Parameters:

filterExpression (Optional[str])

setLayer(self, layer: QgsVectorLayer | None)

The layer from which features should be listed.

Parameters:

layer (Optional[QgsVectorLayer])

setShowBrowserButtons(self, showBrowserButtons: bool)

Defines if the browsing buttons are shown

Note

Buttons are browsing the currently fetched features. If a limit is set, there might be more features to be fetched from the layer.

Parameters:

showBrowserButtons (bool)

sharedPainter(self) QPainter | None
showBrowserButtons(self) bool

Returns if the browsing buttons are shown

Return type:

bool

showBrowserButtonsChanged

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

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