#include <qgsattributeform.h>
Public Slots |
void | changeAttribute (const QString &field, const QVariant &value) |
| Call this to change the content of a given attribute.
|
void | setFeature (const QgsFeature &feature) |
| Update all editors to correspond to a different feature.
|
bool | save () |
| Save all the values from the editors to the layer.
|
Q_DECL_DEPRECATED void | accept () |
| Alias for save()
|
Q_DECL_DEPRECATED void | reject () |
| Alias for resetValues()
|
void | resetValues () |
| Sets all values to the values of the current 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.
|
Constructor & Destructor Documentation
QgsAttributeForm::~QgsAttributeForm |
( |
| ) |
|
Member Function Documentation
Q_DECL_DEPRECATED void QgsAttributeForm::accept |
( |
| ) |
|
|
inlineslot |
Takes ownership.
- Parameters
-
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 |
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.
bool QgsAttributeForm::editable |
( |
| ) |
|
Returns if the form is currently in editable mode.
- Returns
- Editable mode of this form
bool QgsAttributeForm::eventFilter |
( |
QObject * |
object, |
|
|
QEvent * |
event |
|
) |
| |
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)
void QgsAttributeForm::featureSaved |
( |
const QgsFeature & |
feature | ) |
|
|
signal |
Is emitted, when a feature is changed or added.
void QgsAttributeForm::hideButtonBox |
( |
| ) |
|
Hides the button box (Ok/Cancel) and enables auto-commit.
Returns the layer for which this form is shown.
- Returns
- Layer
Q_DECL_DEPRECATED void QgsAttributeForm::reject |
( |
| ) |
|
|
inlineslot |
void QgsAttributeForm::resetValues |
( |
| ) |
|
|
slot |
Sets all values to the values of the current feature.
bool QgsAttributeForm::save |
( |
| ) |
|
|
slot |
Save all the values from the editors to the layer.
- Returns
- True if successful
void QgsAttributeForm::setEditCommandMessage |
( |
const QString & |
message | ) |
|
|
inline |
Sets the edit command message (Undo) that will be used when the dialog is accepted.
- Parameters
-
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 |
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. |
void QgsAttributeForm::showButtonBox |
( |
| ) |
|
Shows the button box (Ok/Cancel) and disables auto-commit.
The documentation for this class was generated from the following files: