16 #ifndef QGSATTRIBUTEEDITORELEMENT_H 17 #define QGSATTRIBUTEEDITORELEMENT_H 19 #include "qgis_core.h" 41 switch ( sipCpp->type() )
44 sipType = sipType_QgsAttributeEditorContainer;
47 sipType = sipType_QgsAttributeEditorField;
50 sipType = sipType_QgsAttributeEditorRelation;
88 QString
name()
const {
return mName; }
111 QDomElement toDomElement( QDomDocument &doc )
const;
125 bool showLabel()
const;
132 void setShowLabel(
bool showLabel );
149 virtual void saveConfiguration( QDomElement &elem )
const = 0;
157 virtual QString typeIdentifier()
const = 0;
178 , mIsGroupBox( true )
211 QList<QgsAttributeEditorElement *>
children()
const {
return mChildren; }
230 void setName(
const QString &name );
235 int columnCount()
const;
240 void setColumnCount(
int columnCount );
268 void saveConfiguration( QDomElement &elem )
const override;
269 QString typeIdentifier()
const override;
272 QList<QgsAttributeEditorElement *> mChildren;
301 int idx()
const {
return mIdx; }
306 void saveConfiguration( QDomElement &elem )
const override;
307 QString typeIdentifier()
const override;
328 , mRelationId( relationId )
329 , mShowLinkButton( true )
330 , mShowUnlinkButton( true )
342 , mRelationId( relation.id() )
343 , mRelation( relation )
344 , mShowLinkButton( true )
345 , mShowUnlinkButton( true )
370 bool showLinkButton()
const;
377 void setShowLinkButton(
bool showLinkButton );
384 bool showUnlinkButton()
const;
391 void setShowUnlinkButton(
bool showUnlinkButton );
395 void saveConfiguration( QDomElement &elem )
const override;
396 QString typeIdentifier()
const override;
399 bool mShowLinkButton;
400 bool mShowUnlinkButton;
404 #endif // QGSATTRIBUTEEDITORELEMENT_H
This is an abstract base class for any elements of a drag and drop form.
QgsAttributeEditorRelation(const QString &name, const QString &relationId, QgsAttributeEditorElement *parent)
Creates a new element which embeds a relation.
const QgsRelation & relation() const
Get the id of the relation which shall be embedded.
This element will load a field's widget onto the form.
This element will load a relation editor onto the form.
AttributeEditorType type() const
The type of this element.
An expression with an additional enabled flag.
QgsAttributeEditorRelation(const QString &name, const QgsRelation &relation, QgsAttributeEditorElement *parent)
Creates a new element which embeds a relation.
QgsAttributeEditorElement * parent() const
Get the parent of this element.
QgsAttributeEditorField(const QString &name, int idx, QgsAttributeEditorElement *parent)
Creates a new attribute editor element which represents a field.
int idx() const
Return the index of the field.
QList< QgsAttributeEditorElement * > children() const
Get a list of the children elements of this container.
QgsAttributeEditorContainer(const QString &name, QgsAttributeEditorElement *parent)
Creates a new attribute editor container.
virtual void setIsGroupBox(bool isGroupBox)
Determines if this container is rendered as collapsible group box or tab in a tabwidget.
This class manages a set of relations between layers.
QgsAttributeEditorElement(AttributeEditorType type, const QString &name, QgsAttributeEditorElement *parent=nullptr)
Constructor.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
This is a container for attribute editors, used to group them visually in the attribute form if it is...
virtual bool isGroupBox() const
Returns if this container is going to be rendered as a group box.
QString name() const
Return the name of this element.
virtual QgsAttributeEditorElement * clone(QgsAttributeEditorElement *parent) const =0
Returns a clone of this element.
AttributeEditorType mType