The QgsFieldComboBox is a combo box which displays the list of fields of a given layer.
More...
#include <qgsfieldcombobox.h>
|
void | fieldChanged (const QString &fieldName) |
| Emitted when the currently selected field changes. More...
|
|
The QgsFieldComboBox is a combo box which displays the list of fields of a given layer.
It might be combined with a QgsMapLayerComboBox to automatically update fields according to a chosen layer. If expression must be used, QgsFieldExpressionWidget shall be used instead.
- See also
- QgsMapLayerComboBox
- Since
- QGIS 2.3
Definition at line 38 of file qgsfieldcombobox.h.
◆ QgsFieldComboBox()
QgsFieldComboBox::QgsFieldComboBox |
( |
QWidget * |
parent = nullptr | ) |
|
|
explicit |
◆ allowEmptyFieldName()
bool QgsFieldComboBox::allowEmptyFieldName |
( |
| ) |
const |
◆ currentField()
QString QgsFieldComboBox::currentField |
( |
| ) |
const |
◆ fieldChanged
void QgsFieldComboBox::fieldChanged |
( |
const QString & |
fieldName | ) |
|
|
signal |
Emitted when the currently selected field changes.
◆ fields()
Returns the fields currently shown in the combobox.
This will either be fields from the associated layer() or the fields manually set by a call to setFields().
- Since
- QGIS 3.14
Definition at line 62 of file qgsfieldcombobox.cpp.
◆ filters()
QgsFieldProxyModel::Filters QgsFieldComboBox::filters |
( |
| ) |
const |
|
inline |
◆ indexChanged
void QgsFieldComboBox::indexChanged |
( |
int |
i | ) |
|
|
protectedslot |
◆ layer()
◆ setAllowEmptyFieldName()
void QgsFieldComboBox::setAllowEmptyFieldName |
( |
bool |
allowEmpty | ) |
|
◆ setField
void QgsFieldComboBox::setField |
( |
const QString & |
fieldName | ) |
|
|
slot |
◆ setFields()
void QgsFieldComboBox::setFields |
( |
const QgsFields & |
fields | ) |
|
Manually sets the fields to use for the combo box.
This method should only be used when the combo box ISN'T associated with a layer() and needs to show the fields from an arbitrary field collection instead. Calling setFields() will automatically clear any existing layer().
- See also
- fields()
- Since
- QGIS 3.14
Definition at line 57 of file qgsfieldcombobox.cpp.
◆ setFilters()
void QgsFieldComboBox::setFilters |
( |
QgsFieldProxyModel::Filters |
filters | ) |
|
setFilters allows filtering according to the type of field
Definition at line 31 of file qgsfieldcombobox.cpp.
◆ setLayer
Sets the layer for which fields are listed in the combobox.
If no layer is set or a non-vector layer is set then the combobox will be empty.
- See also
- layer()
Definition at line 46 of file qgsfieldcombobox.cpp.
◆ allowEmptyFieldName
bool QgsFieldComboBox::allowEmptyFieldName |
|
readwrite |
◆ filters
QgsFieldProxyModel::Filters QgsFieldComboBox::filters |
|
readwrite |
The documentation for this class was generated from the following files: