Class: QgsFeaturePickerWidget

class qgis.gui.QgsFeaturePickerWidget(parent: QWidget = None)

Bases: PyQt5.QtWidgets.QWidget

Create a new QgsFeaturePickerWidget, optionally specifying a parent.

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.

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

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

displayExpressionChanged

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

featureChanged

Sends the feature as soon as it is chosen [signal]

fetchGeometryChanged

Emitted when the fetching of the geometry changes [signal]

fetchLimitChanged

Emitted when the fetching limit for the feature request changes [signal]

filterExpressionChanged

An additional expression to further restrict the available features.

layerChanged

The layer from which features should be listed.

modelUpdated

The underlying model has been updated.

showBrowserButtonsChanged

Emitted when showing the browser buttons changes [signal]

actionEvent(self, QActionEvent)
allowNull(self)bool

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

Return type

bool

allowNullChanged

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

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

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

dragEnterEvent(self, QDragEnterEvent)
dragLeaveEvent(self, QDragLeaveEvent)
dragMoveEvent(self, QDragMoveEvent)
dropEvent(self, QDropEvent)
enterEvent(self, QEvent)
event(self, QEvent)bool
feature(self)QgsFeature

Returns the current feature

Return type

QgsFeature

featureChanged

Sends the feature as soon as it is chosen [signal]

Parameters

feature (QgsFeature) –

fetchGeometry(self)bool

Returns if the geometry is fetched

Return type

bool

fetchGeometryChanged

Emitted when the fetching of the geometry changes [signal]

fetchLimit(self)int

Returns the feature request fetch limit

Return type

int

fetchLimitChanged

Emitted when the fetching limit for the feature request changes [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

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

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

event (QFocusEvent) –

focusPreviousChild(self)bool
hideEvent(self, QHideEvent)
initPainter(self, QPainter)
inputMethodEvent(self, QInputMethodEvent)
isSignalConnected(self, QMetaMethod)bool
keyPressEvent(self, event: QKeyEvent)
Parameters

event (QKeyEvent) –

keyReleaseEvent(self, QKeyEvent)
layer(self)QgsVectorLayer

The layer from which features should be listed.

Return type

QgsVectorLayer

layerChanged

The layer from which features should be listed. [signal]

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

The underlying model has been updated. [signal]

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]
nullIndex(self)int

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

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

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

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)

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

Parameters

filterExpression (str) –

setLayer(self, layer: QgsVectorLayer)

The layer from which features should be listed.

Parameters

layer (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
showBrowserButtons(self)bool

Returns if the browsing buttons are shown

Return type

bool

showBrowserButtonsChanged

Emitted when showing the browser buttons changes [signal]

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