Class: QgsFeaturePickerWidget¶
- class qgis.gui.QgsFeaturePickerWidget(parent: QWidget = None)¶
Bases:
PyQt5.QtWidgets.QWidget
Create a new
QgsFeaturePickerWidget
, optionally specifying aparent
.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.14:
Methods
Determines if a NULL value should be available in the list.
The index of the currently selected item.
The display expression will be used to display features as well as the value to match the typed text against.
Returns the current feature
Returns if the geometry is fetched
Returns the feature request fetch limit
An additional expression to further restrict the available features.
- param event
- param event
The layer from which features should be listed.
Returns the current index of the NULL value, or -1 if NULL values are not allowed.
Determines if a NULL value should be available in the list.
The display expression will be used to display features as well as the value to match the typed text against.
Sets the current index by using the given feature
Defines if the geometry will be fetched
Defines the feature request fetch limit If set to 0, no limit is applied when fetching
An additional expression to further restrict the available features.
The layer from which features should be listed.
Defines if the browsing buttons are shown
Returns if the browsing buttons are shown
Signals
Determines if a NULL value should be available in the list.
The display expression will be used to display features as well as the the value to match the typed text against.
Sends the feature as soon as it is chosen [signal]
Emitted when the fetching of the geometry changes [signal]
Emitted when the fetching limit for the feature request changes [signal]
An additional expression to further restrict the available features.
The layer from which features should be listed.
The underlying model has been updated.
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
- 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
- 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) –
- 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)¶