QGIS API Documentation 3.41.0-Master (3440c17df1d)
|
This offers a combobox with autocompleter that allows selecting features from a layer. More...
#include <qgsfeaturepickerwidget.h>
Signals | |
void | allowNullChanged () |
Determines if a NULL value should be available in the list. | |
void | displayExpressionChanged () |
The display expression will be used to display features as well as the the value to match the typed text against. | |
void | featureChanged (const QgsFeature &feature) |
Sends the feature as soon as it is chosen. | |
void | fetchGeometryChanged () |
Emitted when the fetching of the geometry changes. | |
void | fetchLimitChanged () |
Emitted when the fetching limit for the feature request changes. | |
void | filterExpressionChanged () |
An additional expression to further restrict the available features. | |
void | layerChanged () |
The layer from which features should be listed. | |
void | modelUpdated () |
The underlying model has been updated. | |
void | showBrowserButtonsChanged () |
Emitted when showing the browser buttons changes. | |
Public Member Functions | |
QgsFeaturePickerWidget (QWidget *parent=nullptr) | |
Create a new QgsFeaturePickerWidget, optionally specifying a parent. | |
bool | allowNull () const |
Determines if a NULL value should be available in the list. | |
QModelIndex | currentModelIndex () const |
The index of the currently selected item. | |
QString | displayExpression () const |
The display expression will be used to display features as well as the value to match the typed text against. | |
QgsFeature | feature () const |
Returns the current feature. | |
bool | fetchGeometry () const |
Returns if the geometry is fetched. | |
int | fetchLimit () const |
Returns the feature request fetch limit. | |
QString | filterExpression () const |
An additional expression to further restrict the available features. | |
void | focusOutEvent (QFocusEvent *event) override |
void | keyPressEvent (QKeyEvent *event) override |
QgsVectorLayer * | layer () const |
The layer from which features should be listed. | |
int | nullIndex () const |
Returns the current index of the NULL value, or -1 if NULL values are not allowed. | |
void | setAllowNull (bool allowNull) |
Determines if a NULL value should be available in the list. | |
void | setDisplayExpression (const QString &displayExpression) |
The display expression will be used to display features as well as the value to match the typed text against. | |
void | setFeature (QgsFeatureId featureId) |
Sets the current index by using the given feature. | |
void | setFetchGeometry (bool fetchGeometry) |
Defines if the geometry will be fetched. | |
void | setFetchLimit (int fetchLimit) |
Defines the feature request fetch limit If set to 0, no limit is applied when fetching. | |
void | setFilterExpression (const QString &filterExpression) |
An additional expression to further restrict the available features. | |
void | setLayer (QgsVectorLayer *layer) |
The layer from which features should be listed. | |
void | setShowBrowserButtons (bool showBrowserButtons) |
Defines if the browsing buttons are shown. | |
bool | showBrowserButtons () const |
Returns if the browsing buttons are shown. | |
Properties | |
bool | allowNull |
QString | displayExpression |
bool | fetchGeometry |
int | fetchLimit |
QString | filterExpression |
QgsVectorLayer * | layer |
bool | showBrowserButtons |
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.
Definition at line 43 of file qgsfeaturepickerwidget.h.
QgsFeaturePickerWidget::QgsFeaturePickerWidget | ( | QWidget * | parent = nullptr | ) |
Create a new QgsFeaturePickerWidget, optionally specifying a parent.
Definition at line 25 of file qgsfeaturepickerwidget.cpp.
bool QgsFeaturePickerWidget::allowNull | ( | ) | const |
Determines if a NULL value should be available in the list.
Definition at line 237 of file qgsfeaturepickerwidget.cpp.
|
signal |
Determines if a NULL value should be available in the list.
QModelIndex QgsFeaturePickerWidget::currentModelIndex | ( | ) | const |
The index of the currently selected item.
Definition at line 216 of file qgsfeaturepickerwidget.cpp.
QString QgsFeaturePickerWidget::displayExpression | ( | ) | const |
The display expression will be used to display features as well as the value to match the typed text against.
Definition at line 107 of file qgsfeaturepickerwidget.cpp.
|
signal |
The display expression will be used to display features as well as the the value to match the typed text against.
QgsFeature QgsFeaturePickerWidget::feature | ( | ) | const |
Returns the current feature.
Definition at line 102 of file qgsfeaturepickerwidget.cpp.
|
signal |
Sends the feature as soon as it is chosen.
bool QgsFeaturePickerWidget::fetchGeometry | ( | ) | const |
Returns if the geometry is fetched.
Definition at line 258 of file qgsfeaturepickerwidget.cpp.
|
signal |
Emitted when the fetching of the geometry changes.
int QgsFeaturePickerWidget::fetchLimit | ( | ) | const |
Returns the feature request fetch limit.
Definition at line 268 of file qgsfeaturepickerwidget.cpp.
|
signal |
Emitted when the fetching limit for the feature request changes.
QString QgsFeaturePickerWidget::filterExpression | ( | ) | const |
An additional expression to further restrict the available features.
This can be used to integrate additional spatial or other constraints.
Definition at line 248 of file qgsfeaturepickerwidget.cpp.
|
signal |
An additional expression to further restrict the available features.
This can be used to integrate additional spatial or other constraints.
|
override |
Definition at line 221 of file qgsfeaturepickerwidget.cpp.
|
override |
Definition at line 228 of file qgsfeaturepickerwidget.cpp.
QgsVectorLayer * QgsFeaturePickerWidget::layer | ( | ) | const |
The layer from which features should be listed.
Definition at line 87 of file qgsfeaturepickerwidget.cpp.
|
signal |
The layer from which features should be listed.
|
signal |
The underlying model has been updated.
int QgsFeaturePickerWidget::nullIndex | ( | ) | const |
Returns the current index of the NULL value, or -1 if NULL values are not allowed.
Definition at line 184 of file qgsfeaturepickerwidget.cpp.
void QgsFeaturePickerWidget::setAllowNull | ( | bool | allowNull | ) |
Determines if a NULL value should be available in the list.
Definition at line 242 of file qgsfeaturepickerwidget.cpp.
void QgsFeaturePickerWidget::setDisplayExpression | ( | const QString & | displayExpression | ) |
The display expression will be used to display features as well as the value to match the typed text against.
Definition at line 112 of file qgsfeaturepickerwidget.cpp.
void QgsFeaturePickerWidget::setFeature | ( | QgsFeatureId | featureId | ) |
Sets the current index by using the given feature.
Definition at line 97 of file qgsfeaturepickerwidget.cpp.
void QgsFeaturePickerWidget::setFetchGeometry | ( | bool | fetchGeometry | ) |
Defines if the geometry will be fetched.
Definition at line 263 of file qgsfeaturepickerwidget.cpp.
void QgsFeaturePickerWidget::setFetchLimit | ( | int | fetchLimit | ) |
Defines the feature request fetch limit If set to 0, no limit is applied when fetching.
Definition at line 273 of file qgsfeaturepickerwidget.cpp.
void QgsFeaturePickerWidget::setFilterExpression | ( | const QString & | filterExpression | ) |
An additional expression to further restrict the available features.
This can be used to integrate additional spatial or other constraints.
Definition at line 253 of file qgsfeaturepickerwidget.cpp.
void QgsFeaturePickerWidget::setLayer | ( | QgsVectorLayer * | layer | ) |
The layer from which features should be listed.
Definition at line 92 of file qgsfeaturepickerwidget.cpp.
void QgsFeaturePickerWidget::setShowBrowserButtons | ( | bool | showBrowserButtons | ) |
Defines if the browsing buttons are shown.
Definition at line 283 of file qgsfeaturepickerwidget.cpp.
bool QgsFeaturePickerWidget::showBrowserButtons | ( | ) | const |
Returns if the browsing buttons are shown.
Definition at line 278 of file qgsfeaturepickerwidget.cpp.
|
signal |
Emitted when showing the browser buttons changes.
|
readwrite |
Definition at line 50 of file qgsfeaturepickerwidget.h.
|
readwrite |
Definition at line 48 of file qgsfeaturepickerwidget.h.
|
readwrite |
Definition at line 51 of file qgsfeaturepickerwidget.h.
|
readwrite |
Definition at line 52 of file qgsfeaturepickerwidget.h.
|
readwrite |
Definition at line 49 of file qgsfeaturepickerwidget.h.
|
readwrite |
Definition at line 47 of file qgsfeaturepickerwidget.h.
|
readwrite |
Definition at line 53 of file qgsfeaturepickerwidget.h.