QGIS API Documentation 3.41.0-Master (cea29feecf2)
|
A line edit with an autocompleter which takes unique values from a vector layer's fields. More...
#include <qgsfieldvalueslineedit.h>
Signals | |
void | attributeIndexChanged (int index) |
Emitted when the field associated with the widget changes. | |
void | layerChanged (QgsVectorLayer *layer) |
Emitted when the layer associated with the widget changes. | |
Signals inherited from QgsFilterLineEdit | |
void | cleared () |
Emitted when the widget is cleared. | |
void | selectOnFocusChanged () |
Will select all text when this widget receives the focus. | |
void | showSpinnerChanged () |
Show a spinner icon. | |
void | valueChanged (const QString &value) |
Same as textChanged() but with support for null values. | |
Public Member Functions | |
QgsFieldValuesLineEdit (QWidget *parent=nullptr) | |
Constructor for QgsFieldValuesLineEdit. | |
~QgsFieldValuesLineEdit () override | |
int | attributeIndex () const |
Returns the attribute index for the field containing values shown in the widget. | |
QgsVectorLayer * | layer () const |
Returns the layer containing the field that values will be shown from. | |
void | setAttributeIndex (int index) |
Sets the attribute index for the field containing values to show in the widget. | |
void | setLayer (QgsVectorLayer *layer) |
Sets the layer containing the field that values will be shown from. | |
Public Member Functions inherited from QgsFilterLineEdit | |
QgsFilterLineEdit (QWidget *parent=nullptr, const QString &nullValue=QString()) | |
Constructor for QgsFilterLineEdit. | |
ClearMode | clearMode () const |
Returns the clear mode for the widget. | |
QString | defaultValue () const |
Returns the default value for the widget. | |
bool | event (QEvent *event) override |
Reimplemented to enable/disable the clear action depending on read-only status. | |
bool | hasStateStored () const |
Returns if a state is already saved. | |
bool | isNull () const |
Determine if the current text represents null. | |
QString | nullValue () const |
Returns the string used for representing null values in the widget. | |
bool | selectOnFocus () const |
Will select all text when this widget receives the focus. | |
void | setClearMode (ClearMode mode) |
Sets the clear mode for the widget. | |
void | setDefaultValue (const QString &defaultValue) |
Sets the default value for the widget. | |
void | setNullValue (const QString &nullValue) |
Sets the string representation for null values in the widget. | |
void | setSelectOnFocus (bool selectOnFocus) |
Will select all text when this widget receives the focus. | |
void | setShowClearButton (bool visible) |
Sets whether the widget's clear button is visible. | |
void | setShowSearchIcon (bool visible) |
Define if a search icon shall be shown on the left of the image when no text is entered. | |
void | setShowSpinner (bool showSpinner) |
Show a spinner icon. | |
void | setValue (const QString &value) |
Sets the current text for the widget with support for handling null values. | |
bool | showClearButton () const |
Returns true if the widget's clear button is visible. | |
bool | showSearchIcon () const |
Returns if a search icon shall be shown on the left of the image when no text is entered. | |
bool | showSpinner () const |
Show a spinner icon. | |
QString | value () const |
Returns the text of this edit with support for handling null values. | |
Properties | |
int | attributeIndex |
QgsVectorLayer * | layer |
Properties inherited from QgsFilterLineEdit | |
ClearMode | clearMode |
QString | defaultValue |
QString | nullValue |
bool | showClearButton |
bool | showSearchIcon |
bool | showSpinner |
QString | value |
Additional Inherited Members | |
Public Types inherited from QgsFilterLineEdit | |
enum | ClearMode { ClearToNull = 0 , ClearToDefault } |
Behavior when clearing value of widget. More... | |
Public Slots inherited from QgsFilterLineEdit | |
virtual void | clearValue () |
Clears the widget and resets it to the null value. | |
void | restoreState () |
Restores the current state of the line edit (selection and cursor position) | |
void | storeState () |
Stores the current state of the line edit (selection and cursor position) | |
Protected Member Functions inherited from QgsFilterLineEdit | |
void | focusInEvent (QFocusEvent *e) override |
void | mouseReleaseEvent (QMouseEvent *e) override |
A line edit with an autocompleter which takes unique values from a vector layer's fields.
The autocompleter is populated from the vector layer in the background to ensure responsive interaction with the widget.
Definition at line 98 of file qgsfieldvalueslineedit.h.
QgsFieldValuesLineEdit::QgsFieldValuesLineEdit | ( | QWidget * | parent = nullptr | ) |
Constructor for QgsFieldValuesLineEdit.
parent | parent widget |
Definition at line 26 of file qgsfieldvalueslineedit.cpp.
|
override |
Definition at line 40 of file qgsfieldvalueslineedit.cpp.
|
inline |
Returns the attribute index for the field containing values shown in the widget.
Definition at line 142 of file qgsfieldvalueslineedit.h.
|
signal |
Emitted when the field associated with the widget changes.
index | new attribute index for field |
|
inline |
Returns the layer containing the field that values will be shown from.
Definition at line 127 of file qgsfieldvalueslineedit.h.
|
signal |
Emitted when the layer associated with the widget changes.
layer | vector layer |
void QgsFieldValuesLineEdit::setAttributeIndex | ( | int | index | ) |
Sets the attribute index for the field containing values to show in the widget.
index | index of attribute |
Definition at line 58 of file qgsfieldvalueslineedit.cpp.
void QgsFieldValuesLineEdit::setLayer | ( | QgsVectorLayer * | layer | ) |
Sets the layer containing the field that values will be shown from.
layer | vector layer |
Definition at line 49 of file qgsfieldvalueslineedit.cpp.
|
readwrite |
Definition at line 103 of file qgsfieldvalueslineedit.h.
|
readwrite |
Definition at line 102 of file qgsfieldvalueslineedit.h.