21 mChildren.append( widget );
31 return mVisibilityExpression;
36 if ( visibilityExpression == mVisibilityExpression )
44 QList<QgsAttributeEditorElement *> results;
50 results.append( elem );
66 qDeleteAll( mChildren );
79 mRelation = relationManager->
relation( mRelationId );
86 element->mRelation = mRelation;
87 element->mShowLinkButton = mShowLinkButton;
88 element->mShowUnlinkButton = mShowUnlinkButton;
92 void QgsAttributeEditorField::saveConfiguration( QDomElement &elem )
const 94 elem.setAttribute( QStringLiteral(
"index" ), mIdx );
97 QString QgsAttributeEditorField::typeIdentifier()
const 99 return QStringLiteral(
"attributeEditorField" );
104 QDomElement elem = doc.createElement( typeIdentifier() );
105 elem.setAttribute( QStringLiteral(
"name" ),
mName );
106 elem.setAttribute( QStringLiteral(
"showLabel" ),
mShowLabel );
108 saveConfiguration( elem );
122 void QgsAttributeEditorRelation::saveConfiguration( QDomElement &elem )
const 124 elem.setAttribute( QStringLiteral(
"relation" ), mRelation.id() );
125 elem.setAttribute( QStringLiteral(
"showLinkButton" ), mShowLinkButton );
126 elem.setAttribute( QStringLiteral(
"showUnlinkButton" ), mShowUnlinkButton );
129 QString QgsAttributeEditorRelation::typeIdentifier()
const 131 return QStringLiteral(
"attributeEditorRelation" );
136 return mShowLinkButton;
141 mShowLinkButton = showLinkButton;
146 return mShowUnlinkButton;
151 mShowUnlinkButton = showUnlinkButton;
172 void QgsAttributeEditorQmlElement::saveConfiguration( QDomElement &elem )
const 174 QDomText codeElem = elem.ownerDocument().createTextNode( mQmlCode );
175 elem.appendChild( codeElem );
178 QString QgsAttributeEditorQmlElement::typeIdentifier()
const 180 return QStringLiteral(
"attributeEditorQmlElement" );
void clear()
Clear all children from this container.
An attribute editor widget that will represent arbitrary QML code.
bool init(QgsRelationManager *relManager)
Initializes the relation from the id.
void setName(const QString &name)
Change the name of this container.
This is an abstract base class for any elements of a drag and drop form.
void setVisibilityExpression(const QgsOptionalExpression &visibilityExpression)
The visibility expression is used in the attribute form to show or hide this container based on an ex...
QgsAttributeEditorElement * clone(QgsAttributeEditorElement *parent) const override
Returns a clone of this element.
virtual QList< QgsAttributeEditorElement * > findElements(AttributeEditorType type) const
Traverses the element tree to find any element of the specified type.
This element will load a field's widget onto the form.
QDomElement toDomElement(QDomDocument &doc) const
Gets the XML Dom element to save this element.
QgsAttributeEditorElement * clone(QgsAttributeEditorElement *parent) const override
Returns a clone of this element.
This element will load a relation editor onto the form.
AttributeEditorType type() const
The type of this element.
void setQmlCode(const QString &qmlCode)
The QML code that will be represented within this widget.
An expression with an additional enabled flag.
void setShowLabel(bool showLabel)
Controls if this element should be labeled with a title (field, relation or groupname).
bool showUnlinkButton() const
Determines if the "unlink feature" button should be shown.
bool showLabel() const
Controls if this element should be labeled with a title (field, relation or groupname).
QgsAttributeEditorElement * parent() const
Gets the parent of this element.
QgsOptionalExpression visibilityExpression() const
The visibility expression is used in the attribute form to show or hide this container based on an ex...
QString qmlCode() const
The QML code that will be represented within this widget.
void setShowLinkButton(bool showLinkButton)
Determines if the "link feature" button should be shown.
void setShowUnlinkButton(bool showUnlinkButton)
Determines if the "unlink feature" button should be shown.
This class manages a set of relations between layers.
QgsAttributeEditorElement * clone(QgsAttributeEditorElement *parent) const override
Returns a clone of this element.
This is a container for attribute editors, used to group them visually in the attribute form if it is...
virtual void addChildElement(QgsAttributeEditorElement *element)
Add a child element to this container.
bool showLinkButton() const
Determines if the "link feature" button should be shown.
Q_INVOKABLE QgsRelation relation(const QString &id) const
Gets access to a relation by its id.
QString name() const
Returns the name of this element.