QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
22 mChildren.append( widget );
32 return mVisibilityExpression;
45 return mBackgroundColor;
55 QList<QgsAttributeEditorElement *> results;
57 const auto constMChildren = mChildren;
60 if ( elem->type() ==
type )
62 results.append( elem );
78 qDeleteAll( mChildren );
91 mRelation = relationManager->
relation( mRelationId );
98 element->mRelation = mRelation;
99 element->mShowLinkButton = mShowLinkButton;
100 element->mShowUnlinkButton = mShowUnlinkButton;
104 void QgsAttributeEditorField::saveConfiguration( QDomElement &elem )
const
106 elem.setAttribute( QStringLiteral(
"index" ), mIdx );
109 QString QgsAttributeEditorField::typeIdentifier()
const
111 return QStringLiteral(
"attributeEditorField" );
116 QDomElement elem = doc.createElement( typeIdentifier() );
117 elem.setAttribute( QStringLiteral(
"name" ),
mName );
118 elem.setAttribute( QStringLiteral(
"showLabel" ),
mShowLabel );
119 saveConfiguration( elem );
133 void QgsAttributeEditorRelation::saveConfiguration( QDomElement &elem )
const
135 elem.setAttribute( QStringLiteral(
"relation" ), mRelation.
id() );
136 elem.setAttribute( QStringLiteral(
"showLinkButton" ), mShowLinkButton );
137 elem.setAttribute( QStringLiteral(
"showUnlinkButton" ), mShowUnlinkButton );
138 elem.setAttribute( QStringLiteral(
"showSaveChildEditsButton" ), mShowSaveChildEditsButton );
141 QString QgsAttributeEditorRelation::typeIdentifier()
const
143 return QStringLiteral(
"attributeEditorRelation" );
148 return mShowLinkButton;
158 return mShowUnlinkButton;
168 mShowSaveChildEditsButton = showSaveChildEdits;
173 return mShowSaveChildEditsButton;
194 void QgsAttributeEditorQmlElement::saveConfiguration( QDomElement &elem )
const
196 QDomText codeElem = elem.ownerDocument().createTextNode( mQmlCode );
197 elem.appendChild( codeElem );
200 QString QgsAttributeEditorQmlElement::typeIdentifier()
const
202 return QStringLiteral(
"attributeEditorQmlElement" );
223 void QgsAttributeEditorHtmlElement::saveConfiguration( QDomElement &elem )
const
225 QDomText codeElem = elem.ownerDocument().createTextNode( mHtmlCode );
226 elem.appendChild( codeElem );
229 QString QgsAttributeEditorHtmlElement::typeIdentifier()
const
231 return QStringLiteral(
"attributeEditorHtmlElement" );
QgsAttributeEditorElement * clone(QgsAttributeEditorElement *parent) const override
Returns a clone of this element.
void setVisibilityExpression(const QgsOptionalExpression &visibilityExpression)
The visibility expression is used in the attribute form to show or hide this container based on an ex...
bool showLinkButton() const
Determines if the "link feature" button should be shown.
virtual QList< QgsAttributeEditorElement * > findElements(AttributeEditorType type) const
Traverses the element tree to find any element of the specified type.
void setShowLabel(bool showLabel)
Controls if this element should be labeled with a title (field, relation or groupname).
QgsAttributeEditorElement * clone(QgsAttributeEditorElement *parent) const override
Returns a clone of this element.
void setName(const QString &name)
Change the name of this container.
void setShowUnlinkButton(bool showUnlinkButton)
Determines if the "unlink feature" button should be shown.
void setShowSaveChildEditsButton(bool showSaveChildEditsButton)
Determines if the "save child layer edits" button should be shown.
Q_INVOKABLE QgsRelation relation(const QString &id) const
Gets access to a relation by its id.
QgsAttributeEditorHtmlElement(const QString &name, QgsAttributeEditorElement *parent)
Creates a new element which can display HTML.
bool init(QgsRelationManager *relManager)
Initializes the relation from the id.
void setShowLinkButton(bool showLinkButton)
Determines if the "link feature" button should be shown.
@ AeTypeContainer
A container.
bool showLabel() const
Controls if this element should be labeled with a title (field, relation or groupname).
QgsAttributeEditorField(const QString &name, int idx, QgsAttributeEditorElement *parent)
Creates a new attribute editor element which represents a field.
QgsAttributeEditorElement * clone(QgsAttributeEditorElement *parent) const override
Returns a clone of this element.
void setQmlCode(const QString &qmlCode)
Sets the QML code that will be represented within this widget to qmlCode.
QString qmlCode() const
The QML code that will be represented within this widget.
bool showUnlinkButton() const
Determines if the "unlink feature" button should be shown.
void setHtmlCode(const QString &htmlCode)
Sets the HTML code that will be represented within this widget to htmlCode.
QgsAttributeEditorElement * clone(QgsAttributeEditorElement *parent) const override
Returns a clone of this element.
Q_DECL_DEPRECATED QgsAttributeEditorRelation(const QString &name, const QString &relationId, QgsAttributeEditorElement *parent)
QString htmlCode() const
The QML code that will be represented within this widget.
void setBackgroundColor(const QColor &backgroundColor)
Sets the background color to backgroundColor.
void clear()
Clear all children from this container.
QgsAttributeEditorQmlElement(const QString &name, QgsAttributeEditorElement *parent)
Creates a new element which can display QML.
bool showSaveChildEditsButton() const
Returns true if the "save child layer edits" button should be shown.
AttributeEditorType type() const
The type 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 name() const
Returns the name of this element.
QDomElement toDomElement(QDomDocument &doc) const
Gets the XML Dom element to save this element.
virtual void addChildElement(QgsAttributeEditorElement *element)
Add a child element to this container.
QgsAttributeEditorElement * parent() const
Gets the parent of this element.
QColor backgroundColor() const
backgroundColor