#include <qgsattributeform.h>
Definition at line 44 of file qgsattributeform.h.
◆ FilterType
Filter types.
Enumerator |
---|
ReplaceFilter | Filter should replace any existing filter.
|
FilterAnd | Filter should be combined using "AND".
|
FilterOr | Filter should be combined using "OR".
|
Definition at line 63 of file qgsattributeform.h.
◆ Mode
Form modes.
- Deprecated:
- Use QgsAttributeEditorContext::Mode instead.
Enumerator |
---|
SingleEditMode | Single edit mode, for editing a single feature.
|
AddFeatureMode | Add feature mode, for setting attributes for a new feature. In this mode the dialog will be editable even with an invalid feature and will add a new feature when the form is accepted.
|
MultiEditMode | Multi edit mode, for editing fields of multiple features at once.
|
SearchMode | Form values are used for searching/filtering the layer.
|
AggregateSearchMode | Form is in aggregate search mode, show each widget in this mode.
- Since
- QGIS 3.0
|
IdentifyMode | Identify the feature.
- Since
- QGIS 3.0
|
Definition at line 51 of file qgsattributeform.h.
◆ QgsAttributeForm()
◆ ~QgsAttributeForm()
QgsAttributeForm::~QgsAttributeForm |
( |
| ) |
|
|
override |
◆ addInterface()
◆ aggregateFilter()
QString QgsAttributeForm::aggregateFilter |
( |
| ) |
const |
The aggregate filter is only useful if the form is in AggregateFilter mode.
In this case it will return a combined expression according to the chosen filters on all attribute widgets.
- Since
- QGIS 3.0
Definition at line 2408 of file qgsattributeform.cpp.
◆ attributeChanged
Q_DECL_DEPRECATED void QgsAttributeForm::attributeChanged |
( |
const QString & |
attribute, |
|
|
const QVariant & |
value |
|
) |
| |
|
signal |
Notifies about changes of attributes, this signal is not emitted when the value is set back to the original one.
- Parameters
-
attribute | The name of the attribute that changed. |
value | The new value of the attribute. |
- Deprecated:
- since 3.0
◆ beforeSave
void QgsAttributeForm::beforeSave |
( |
bool & |
ok | ) |
|
|
signal |
Will be emitted before the feature is saved.
Use this signal to perform sanity checks. You can set the parameter ok to false
to notify the form that you don't want it to be saved. If you want the form to be saved, leave the parameter untouched.
- Parameters
-
ok | Set this parameter to false if you don't want the form to be saved |
- Note
- not available in Python bindings
◆ changeAttribute
void QgsAttributeForm::changeAttribute |
( |
const QString & |
field, |
|
|
const QVariant & |
value, |
|
|
const QString & |
hintText = QString() |
|
) |
| |
|
slot |
Call this to change the content of a given attribute.
Will update the editor(s) related to this field.
- Parameters
-
field | The field to change |
value | The new value |
hintText | A hint text for non existent joined features |
Definition at line 254 of file qgsattributeform.cpp.
◆ closed
void QgsAttributeForm::closed |
( |
| ) |
|
|
signal |
Emitted when the user selects the close option from the form's button bar.
- Since
- QGIS 2.16
◆ currentFormFeature()
QgsFeature QgsAttributeForm::currentFormFeature |
( |
| ) |
const |
|
inline |
Returns the feature that is currently displayed in the form with all the changes received on editing the values in the widgets.
- Since
- QGIS 3.16
Definition at line 84 of file qgsattributeform.h.
◆ disconnectButtonBox()
void QgsAttributeForm::disconnectButtonBox |
( |
| ) |
|
Disconnects the button box (OK/Cancel) from the accept/resetValues slots If this method is called, you have to create these connections from outside.
Definition at line 115 of file qgsattributeform.cpp.
◆ displayWarning()
void QgsAttributeForm::displayWarning |
( |
const QString & |
message | ) |
|
Displays a warning message in the form message bar.
- Parameters
-
- See also
- mode()
- Since
- QGIS 3.12
Definition at line 626 of file qgsattributeform.cpp.
◆ editable()
bool QgsAttributeForm::editable |
( |
| ) |
|
Returns if the form is currently in editable mode.
- Returns
- Editable mode of this form
Definition at line 126 of file qgsattributeform.cpp.
◆ eventFilter()
bool QgsAttributeForm::eventFilter |
( |
QObject * |
object, |
|
|
QEvent * |
event |
|
) |
| |
|
override |
Intercepts keypress on custom form (escape should not close it)
- Parameters
-
object | The object for which the event has been sent |
event | The event which is being filtered |
- Returns
true
if the event has been handled (key was ESC)
Definition at line 2244 of file qgsattributeform.cpp.
◆ feature()
◆ featureSaved
void QgsAttributeForm::featureSaved |
( |
const QgsFeature & |
feature | ) |
|
|
signal |
Emitted when a feature is changed or added.
◆ filterExpressionSet
Emitted when a filter expression is set using the form.
- Parameters
-
expression | filter expression |
type | filter type |
- Since
- QGIS 2.16
◆ flashFeatures
void QgsAttributeForm::flashFeatures |
( |
const QString & |
filter | ) |
|
|
signal |
Emitted when the user chooses to flash a filtered set of features.
- Since
- QGIS 3.0
◆ hideButtonBox()
void QgsAttributeForm::hideButtonBox |
( |
| ) |
|
◆ layer()
Returns the layer for which this form is shown.
- Returns
- Layer
Definition at line 129 of file qgsattributeform.h.
◆ mode()
◆ modeChanged
Emitted when the form changes mode.
- Parameters
-
◆ parentFormValueChanged
void QgsAttributeForm::parentFormValueChanged |
( |
const QString & |
attribute, |
|
|
const QVariant & |
newValue |
|
) |
| |
|
slot |
Is called in embedded forms when an attribute value in the parent form has changed to newValue.
Notify the form widgets that something has changed in case they have filter expressions that depend on the parent form scope.
- Since
- QGIS 3.14
Definition at line 1287 of file qgsattributeform.cpp.
◆ refreshFeature
void QgsAttributeForm::refreshFeature |
( |
| ) |
|
|
slot |
◆ resetSearch
void QgsAttributeForm::resetSearch |
( |
| ) |
|
|
slot |
◆ resetValues
void QgsAttributeForm::resetValues |
( |
| ) |
|
|
slot |
◆ save
bool QgsAttributeForm::save |
( |
| ) |
|
|
slot |
Save all the values from the editors to the layer.
- Returns
true
if successful
Definition at line 738 of file qgsattributeform.cpp.
◆ setEditCommandMessage()
void QgsAttributeForm::setEditCommandMessage |
( |
const QString & |
message | ) |
|
|
inline |
Sets the edit command message (Undo) that will be used when the dialog is accepted.
- Parameters
-
Definition at line 158 of file qgsattributeform.h.
◆ setExtraContextScope()
Sets an additional expression context scope to be used for calculations in this form.
- Since
- QGIS 3.16
Definition at line 2426 of file qgsattributeform.cpp.
◆ setFeature
void QgsAttributeForm::setFeature |
( |
const QgsFeature & |
feature | ) |
|
|
slot |
Update all editors to correspond to a different feature.
- Parameters
-
feature | The feature which will be represented by the form |
Definition at line 281 of file qgsattributeform.cpp.
◆ setMessageBar()
void QgsAttributeForm::setMessageBar |
( |
QgsMessageBar * |
messageBar | ) |
|
Sets the message bar to display feedback from the form in.
This is used in the search/filter mode to display the count of selected features.
- Parameters
-
messageBar | target message bar |
- Since
- QGIS 2.16
Definition at line 2400 of file qgsattributeform.cpp.
◆ setMode()
◆ setMultiEditFeatureIds()
void QgsAttributeForm::setMultiEditFeatureIds |
( |
const QgsFeatureIds & |
fids | ) |
|
Sets all feature IDs which are to be edited if the form is in multiedit mode.
- Parameters
-
- Since
- QGIS 2.16
Definition at line 2320 of file qgsattributeform.cpp.
◆ showButtonBox()
void QgsAttributeForm::showButtonBox |
( |
| ) |
|
◆ widgetValueChanged
void QgsAttributeForm::widgetValueChanged |
( |
const QString & |
attribute, |
|
|
const QVariant & |
value, |
|
|
bool |
attributeChanged |
|
) |
| |
|
signal |
Notifies about changes of attributes.
- Parameters
-
attribute | The name of the attribute that changed. |
value | The new value of the attribute. |
attributeChanged | If true , it corresponds to an actual change of the feature attribute |
- Since
- QGIS 3.0.1
◆ zoomToFeatures
void QgsAttributeForm::zoomToFeatures |
( |
const QString & |
filter | ) |
|
|
signal |
Emitted when the user chooses to zoom to a filtered set of features.
- Since
- QGIS 3.0
◆ TestQgsAttributeForm
friend class TestQgsAttributeForm |
|
friend |
◆ TestQgsDualView
friend class TestQgsDualView |
|
friend |
The documentation for this class was generated from the following files: