36 element->mUuid = mUuid;
43 if ( ! mAction.isValid() && ! mUuid.isNull() && layer )
52 mUuid = newAction.
id();
56QString QgsAttributeEditorAction::typeIdentifier()
const
58 return QStringLiteral(
"attributeEditorAction" );
61void QgsAttributeEditorAction::saveConfiguration( QDomElement &elem, QDomDocument &doc )
const
64 elem.setAttribute( QStringLiteral(
"ActionUUID" ), mUuid.toString() );
67void QgsAttributeEditorAction::loadConfiguration(
const QDomElement &element,
const QString &layerId,
const QgsReadWriteContext &context,
const QgsFields &fields )
72 mUuid = QUuid( element.attribute( QStringLiteral(
"ActionUUID" ) ) );
Provides global constants and enumerations for use throughout the application.
QgsAction action(QUuid id) const
Gets an action by its id.
Utility class that encapsulates an action based on vector attributes.
QUuid id() const
Returns a unique id for this action.
const QgsAction & action(const QgsVectorLayer *layer) const
Returns the (possibly lazy loaded) action for the given layer.
QgsAttributeEditorAction(const QgsAction &action, QgsAttributeEditorElement *parent)
Creates a new element which can display a layer action.
QgsAttributeEditorElement * clone(QgsAttributeEditorElement *parent) const override
Returns a clone of this element.
void setAction(const QgsAction &newAction)
Set the action to newAction.
QgsAttributeEditorElement * parent() const
Gets the parent of this element.
QgsAttributeEditorElement(Qgis::AttributeEditorType type, const QString &name, QgsAttributeEditorElement *parent=nullptr)
Constructor.
Container of fields for a vector layer.
A container for the context for various read/write operations on objects.
Represents a vector layer which manages a vector based dataset.
QgsActionManager * actions()
Returns all layer actions defined on this layer.