16 #ifndef QGSATTRIBUTEEDITORELEMENT_H 17 #define QGSATTRIBUTEEDITORELEMENT_H 19 #include "qgis_core.h" 42 switch ( sipCpp->type() )
45 sipType = sipType_QgsAttributeEditorContainer;
48 sipType = sipType_QgsAttributeEditorField;
51 sipType = sipType_QgsAttributeEditorRelation;
91 QString
name()
const {
return mName; }
114 QDomElement toDomElement( QDomDocument &doc )
const;
128 bool showLabel()
const;
135 void setShowLabel(
bool showLabel );
152 virtual void saveConfiguration( QDomElement &elem )
const = 0;
160 virtual QString typeIdentifier()
const = 0;
182 , mIsGroupBox( true )
184 , mBackgroundColor( backgroundColor )
216 QList<QgsAttributeEditorElement *>
children()
const {
return mChildren; }
235 void setName(
const QString &name );
240 int columnCount()
const;
245 void setColumnCount(
int columnCount );
277 QColor backgroundColor()
const;
282 void setBackgroundColor(
const QColor &backgroundColor );
285 void saveConfiguration( QDomElement &elem )
const override;
286 QString typeIdentifier()
const override;
289 QList<QgsAttributeEditorElement *> mChildren;
292 QColor mBackgroundColor;
318 int idx()
const {
return mIdx; }
323 void saveConfiguration( QDomElement &elem )
const override;
324 QString typeIdentifier()
const override;
341 , mRelationId( relationId )
349 , mRelationId( relation.id() )
350 , mRelation( relation )
361 , mRelationId( relationId )
372 , mRelationId( relation.id() )
373 , mRelation( relation )
399 bool showLinkButton()
const;
406 void setShowLinkButton(
bool showLinkButton );
413 bool showUnlinkButton()
const;
420 void setShowUnlinkButton(
bool showUnlinkButton );
424 void saveConfiguration( QDomElement &elem )
const override;
425 QString typeIdentifier()
const override;
428 bool mShowLinkButton =
true;
429 bool mShowUnlinkButton =
true;
459 QString qmlCode()
const;
464 void setQmlCode(
const QString &qmlCode );
467 void saveConfiguration( QDomElement &elem )
const override;
468 QString typeIdentifier()
const override;
500 QString htmlCode()
const;
505 void setHtmlCode(
const QString &htmlCode );
508 void saveConfiguration( QDomElement &elem )
const override;
509 QString typeIdentifier()
const override;
514 #endif // QGSATTRIBUTEEDITORELEMENT_H
An attribute editor widget that will represent arbitrary QML code.
This is an abstract base class for any elements of a drag and drop form.
QgsAttributeEditorRelation(const QgsRelation &relation, QgsAttributeEditorElement *parent)
Creates a new element which embeds a relation.
const QgsRelation & relation() const
Gets the id of the relation which shall be embedded.
QgsAttributeEditorContainer(const QString &name, QgsAttributeEditorElement *parent, const QColor &backgroundColor=QColor())
Creates a new attribute editor container.
This element will load a field's widget onto the form.
QgsAttributeEditorHtmlElement(const QString &name, QgsAttributeEditorElement *parent)
Creates a new element which can display HTML.
This element will load a relation editor onto the form.
An attribute editor widget that will represent arbitrary HTML code.
AttributeEditorType type() const
The type of this element.
Q_DECL_DEPRECATED QgsAttributeEditorRelation(const QString &name, const QString &relationId, QgsAttributeEditorElement *parent)
An expression with an additional enabled flag.
QgsAttributeEditorElement * parent() const
Gets 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
Returns the index of the field.
QgsAttributeEditorRelation(const QString &relationId, QgsAttributeEditorElement *parent)
Creates a new element which embeds a relation.
QList< QgsAttributeEditorElement * > children() const
Gets a list of the children elements of this container.
Q_DECL_DEPRECATED QgsAttributeEditorRelation(const QString &name, const QgsRelation &relation, QgsAttributeEditorElement *parent)
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...
QgsAttributeEditorQmlElement(const QString &name, QgsAttributeEditorElement *parent)
Creates a new element which can display QML.
virtual bool isGroupBox() const
Returns if this container is going to be rendered as a group box.
QString name() const
Returns the name of this element.
virtual QgsAttributeEditorElement * clone(QgsAttributeEditorElement *parent) const =0
Returns a clone of this element.
AttributeEditorType mType