#include <qgsattributeform.h>
Public Slots |
Q_DECL_DEPRECATED void | accept () |
| Alias for save()
|
void | changeAttribute (const QString &field, const QVariant &value) |
| Call this to change the content of a given attribute.
|
Q_DECL_DEPRECATED void | reject () |
| Alias for resetValues()
|
void | resetValues () |
| Sets all values to the values of the current feature.
|
bool | save () |
| Save all the values from the editors to the layer.
|
void | setFeature (const QgsFeature &feature) |
| Update all editors to correspond to a different feature.
|
Signals |
void | attributeChanged (QString attribute, const QVariant &value) |
| Notifies about changes of attributes.
|
void | beforeSave (bool &ok) |
| Will be emitted before the feature is saved.
|
void | featureSaved (const QgsFeature &feature) |
| Is emitted, when a feature is changed or added.
|
Detailed Description
Definition at line 29 of file qgsattributeform.h.
Constructor & Destructor Documentation
QgsAttributeForm::~QgsAttributeForm |
( |
| ) |
|
Member Function Documentation
Q_DECL_DEPRECATED void QgsAttributeForm::accept |
( |
| ) |
|
|
inlineslot |
void QgsAttributeForm::attributeChanged |
( |
QString |
attribute, |
|
|
const QVariant & |
value |
|
) |
| |
|
signal |
Notifies about changes of attributes.
- Parameters
-
attribute | The name of the attribute that changed. |
value | The new value of the attribute. |
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
void QgsAttributeForm::changeAttribute |
( |
const QString & |
field, |
|
|
const QVariant & |
value |
|
) |
| |
|
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 |
Definition at line 103 of file qgsattributeform.cpp.
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 80 of file qgsattributeform.cpp.
bool QgsAttributeForm::editable |
( |
| ) |
|
Returns if the form is currently in editable mode.
- Returns
- Editable mode of this form
Definition at line 91 of file qgsattributeform.cpp.
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 764 of file qgsattributeform.cpp.
void QgsAttributeForm::featureSaved |
( |
const QgsFeature & |
feature | ) |
|
|
signal |
Is emitted, when a feature is changed or added.
void QgsAttributeForm::hideButtonBox |
( |
| ) |
|
Returns the layer for which this form is shown.
- Returns
- Layer
Definition at line 66 of file qgsattributeform.h.
Q_DECL_DEPRECATED void QgsAttributeForm::reject |
( |
| ) |
|
|
inlineslot |
void QgsAttributeForm::resetValues |
( |
| ) |
|
|
slot |
bool QgsAttributeForm::save |
( |
| ) |
|
|
slot |
Save all the values from the editors to the layer.
- Returns
- True if successful
Definition at line 129 of file qgsattributeform.cpp.
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 89 of file qgsattributeform.h.
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 115 of file qgsattributeform.cpp.
void QgsAttributeForm::setIsAddDialog |
( |
bool |
isAddDialog | ) |
|
Toggles the form mode between edit feature and add feature.
If set to true, the dialog will be editable even with an invalid feature. If set to true, the dialog will add a new feature when the form is accepted.
- Parameters
-
isAddDialog | If set to true, turn this dialog into an add feature dialog. |
Definition at line 96 of file qgsattributeform.cpp.
void QgsAttributeForm::showButtonBox |
( |
| ) |
|
Shows the button box (Ok/Cancel) and disables auto-commit.
Definition at line 73 of file qgsattributeform.cpp.
The documentation for this class was generated from the following files: