QGIS API Documentation 3.41.0-Master (57ec4277f5e)
Loading...
Searching...
No Matches
Signals | Public Member Functions | Properties | List of all members
QgsFeaturePickerWidget Class Reference

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

#include <qgsfeaturepickerwidget.h>

Inheritance diagram for QgsFeaturePickerWidget:
Inheritance graph
[legend]

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

Detailed Description

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.

Since
QGIS 3.14

Definition at line 43 of file qgsfeaturepickerwidget.h.

Constructor & Destructor Documentation

◆ QgsFeaturePickerWidget()

QgsFeaturePickerWidget::QgsFeaturePickerWidget ( QWidget *  parent = nullptr)

Create a new QgsFeaturePickerWidget, optionally specifying a parent.

Definition at line 25 of file qgsfeaturepickerwidget.cpp.

Member Function Documentation

◆ allowNull()

bool QgsFeaturePickerWidget::allowNull ( ) const

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

Definition at line 237 of file qgsfeaturepickerwidget.cpp.

◆ allowNullChanged

void QgsFeaturePickerWidget::allowNullChanged ( )
signal

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

◆ currentModelIndex()

QModelIndex QgsFeaturePickerWidget::currentModelIndex ( ) const

The index of the currently selected item.

Definition at line 216 of file qgsfeaturepickerwidget.cpp.

◆ displayExpression()

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.

◆ displayExpressionChanged

void QgsFeaturePickerWidget::displayExpressionChanged ( )
signal

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

◆ feature()

QgsFeature QgsFeaturePickerWidget::feature ( ) const

Returns the current feature.

Definition at line 102 of file qgsfeaturepickerwidget.cpp.

◆ featureChanged

void QgsFeaturePickerWidget::featureChanged ( const QgsFeature feature)
signal

Sends the feature as soon as it is chosen.

◆ fetchGeometry()

bool QgsFeaturePickerWidget::fetchGeometry ( ) const

Returns if the geometry is fetched.

Definition at line 258 of file qgsfeaturepickerwidget.cpp.

◆ fetchGeometryChanged

void QgsFeaturePickerWidget::fetchGeometryChanged ( )
signal

Emitted when the fetching of the geometry changes.

◆ fetchLimit()

int QgsFeaturePickerWidget::fetchLimit ( ) const

Returns the feature request fetch limit.

Definition at line 268 of file qgsfeaturepickerwidget.cpp.

◆ fetchLimitChanged

void QgsFeaturePickerWidget::fetchLimitChanged ( )
signal

Emitted when the fetching limit for the feature request changes.

◆ filterExpression()

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.

◆ filterExpressionChanged

void QgsFeaturePickerWidget::filterExpressionChanged ( )
signal

An additional expression to further restrict the available features.

This can be used to integrate additional spatial or other constraints.

◆ focusOutEvent()

void QgsFeaturePickerWidget::focusOutEvent ( QFocusEvent *  event)
override

Definition at line 221 of file qgsfeaturepickerwidget.cpp.

◆ keyPressEvent()

void QgsFeaturePickerWidget::keyPressEvent ( QKeyEvent *  event)
override

Definition at line 228 of file qgsfeaturepickerwidget.cpp.

◆ layer()

QgsVectorLayer * QgsFeaturePickerWidget::layer ( ) const

The layer from which features should be listed.

Definition at line 87 of file qgsfeaturepickerwidget.cpp.

◆ layerChanged

void QgsFeaturePickerWidget::layerChanged ( )
signal

The layer from which features should be listed.

◆ modelUpdated

void QgsFeaturePickerWidget::modelUpdated ( )
signal

The underlying model has been updated.

◆ nullIndex()

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.

◆ setAllowNull()

void QgsFeaturePickerWidget::setAllowNull ( bool  allowNull)

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

Definition at line 242 of file qgsfeaturepickerwidget.cpp.

◆ setDisplayExpression()

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.

◆ setFeature()

void QgsFeaturePickerWidget::setFeature ( QgsFeatureId  featureId)

Sets the current index by using the given feature.

Definition at line 97 of file qgsfeaturepickerwidget.cpp.

◆ setFetchGeometry()

void QgsFeaturePickerWidget::setFetchGeometry ( bool  fetchGeometry)

Defines if the geometry will be fetched.

Definition at line 263 of file qgsfeaturepickerwidget.cpp.

◆ setFetchLimit()

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.

◆ setFilterExpression()

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.

◆ setLayer()

void QgsFeaturePickerWidget::setLayer ( QgsVectorLayer layer)

The layer from which features should be listed.

Definition at line 92 of file qgsfeaturepickerwidget.cpp.

◆ setShowBrowserButtons()

void QgsFeaturePickerWidget::setShowBrowserButtons ( bool  showBrowserButtons)

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.

Definition at line 283 of file qgsfeaturepickerwidget.cpp.

◆ showBrowserButtons()

bool QgsFeaturePickerWidget::showBrowserButtons ( ) const

Returns if the browsing buttons are shown.

Definition at line 278 of file qgsfeaturepickerwidget.cpp.

◆ showBrowserButtonsChanged

void QgsFeaturePickerWidget::showBrowserButtonsChanged ( )
signal

Emitted when showing the browser buttons changes.

Property Documentation

◆ allowNull

bool QgsFeaturePickerWidget::allowNull
readwrite

Definition at line 50 of file qgsfeaturepickerwidget.h.

◆ displayExpression

QString QgsFeaturePickerWidget::displayExpression
readwrite

Definition at line 48 of file qgsfeaturepickerwidget.h.

◆ fetchGeometry

bool QgsFeaturePickerWidget::fetchGeometry
readwrite

Definition at line 51 of file qgsfeaturepickerwidget.h.

◆ fetchLimit

int QgsFeaturePickerWidget::fetchLimit
readwrite

Definition at line 52 of file qgsfeaturepickerwidget.h.

◆ filterExpression

QString QgsFeaturePickerWidget::filterExpression
readwrite

Definition at line 49 of file qgsfeaturepickerwidget.h.

◆ layer

QgsVectorLayer * QgsFeaturePickerWidget::layer
readwrite

Definition at line 47 of file qgsfeaturepickerwidget.h.

◆ showBrowserButtons

bool QgsFeaturePickerWidget::showBrowserButtons
readwrite

Definition at line 53 of file qgsfeaturepickerwidget.h.


The documentation for this class was generated from the following files: