30 QDomElement elem = doc.createElement( typeIdentifier() );
31 elem.setAttribute( QStringLiteral(
"name" ),
mName );
32 elem.setAttribute( QStringLiteral(
"showLabel" ),
mShowLabel );
33 saveConfiguration( elem, doc );
51 const QString
name = element.attribute( QStringLiteral(
"name" ) );
53 if ( element.tagName() == QLatin1String(
"attributeEditorContainer" ) )
58 else if ( element.tagName() == QLatin1String(
"attributeEditorField" ) )
63 else if ( element.tagName() == QLatin1String(
"attributeEditorRelation" ) )
69 else if ( element.tagName() == QLatin1String(
"attributeEditorQmlElement" ) )
73 else if ( element.tagName() == QLatin1String(
"attributeEditorHtmlElement" ) )
77 else if ( element.tagName() == QLatin1String(
"attributeEditorAction" ) )
84 if ( element.hasAttribute( QStringLiteral(
"showLabel" ) ) )
85 newElement->
setShowLabel( element.attribute( QStringLiteral(
"showLabel" ) ).toInt() );
89 newElement->loadConfiguration( element, layerId, context, fields );
This element will load a layer action onto the form.
This is a container for attribute editors, used to group them visually in the attribute form if it is...
This is an abstract base class for any elements of a drag and drop form.
QDomElement toDomElement(QDomDocument &doc) const
Gets the XML Dom element to save this element.
bool showLabel() const
Controls if this element should be labeled with a title (field, relation or groupname).
QString name() const
Returns the name of this element.
static QgsAttributeEditorElement * create(const QDomElement &element, const QString &layerId, const QgsFields &fields, const QgsReadWriteContext &context, QgsAttributeEditorElement *parent=nullptr)
Constructs the editor element from the given element.
void setShowLabel(bool showLabel)
Controls if this element should be labeled with a title (field, relation or groupname).
QgsAttributeEditorElement * parent() const
Gets the parent of this element.
This element will load a field's widget onto the form.
An attribute editor widget that will represent arbitrary HTML code.
An attribute editor widget that will represent arbitrary QML code.
This element will load a relation editor onto the form.
Container of fields for a vector layer.
int lookupField(const QString &fieldName) const
Looks up field's index from the field name.
virtual QString translate(const QString &context, const QString &sourceText, const char *disambiguation=nullptr, int n=-1) const =0
The derived translate() translates with QTranslator and qm file the sourceText.
The class is used as a container of context for various read/write operations on other objects.
const QgsProjectTranslator * projectTranslator() const
Returns the project translator.