QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
This is an abstract base class for any elements of a drag and drop form. More...
#include <qgsattributeeditorelement.h>
Classes | |
struct | LabelStyle |
The TabStyle struct defines color and font overrides for form fields, tabs and groups labels. More... | |
Public Types | |
enum | AttributeEditorType { AeTypeContainer, AeTypeField, AeTypeRelation, AeTypeInvalid, AeTypeQmlElement, AeTypeHtmlElement, AeTypeAction } |
Public Member Functions | |
QgsAttributeEditorElement (AttributeEditorType type, const QString &name, QgsAttributeEditorElement *parent=nullptr) | |
Constructor. More... | |
virtual | ~QgsAttributeEditorElement ()=default |
virtual QgsAttributeEditorElement * | clone (QgsAttributeEditorElement *parent) const =0 |
Returns a clone of this element. More... | |
LabelStyle | labelStyle () const |
Returns the label style. More... | |
QString | name () const |
Returns the name of this element. More... | |
QgsAttributeEditorElement * | parent () const |
Gets the parent of this element. More... | |
void | setLabelStyle (const LabelStyle &labelStyle) |
Sets the labelStyle. More... | |
void | setShowLabel (bool showLabel) |
Controls if this element should be labeled with a title (field, relation or groupname). More... | |
bool | showLabel () const |
Controls if this element should be labeled with a title (field, relation or groupname). More... | |
QDomElement | toDomElement (QDomDocument &doc) const |
Gets the XML Dom element to save this element. More... | |
AttributeEditorType | type () const |
The type of this element. More... | |
Static Public Member Functions | |
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. More... | |
Protected Attributes | |
LabelStyle | mLabelStyle |
QString | mName |
QgsAttributeEditorElement * | mParent = nullptr |
bool | mShowLabel |
AttributeEditorType | mType |
This is an abstract base class for any elements of a drag and drop form.
This can either be a container which will be represented on the screen as a tab widget or a collapsible group box. Or it can be a field which will then be represented based on the QgsEditorWidget type and configuration. Or it can be a relation and embed the form of several children of another layer.
Definition at line 37 of file qgsattributeeditorelement.h.
Definition at line 117 of file qgsattributeeditorelement.h.
|
inline |
Constructor.
type | The type of the new element. |
name | |
parent |
Definition at line 135 of file qgsattributeeditorelement.h.
|
virtualdefault |
|
pure virtual |
Returns a clone of this element.
To be implemented by subclasses.
Implemented in QgsAttributeEditorContainer, QgsAttributeEditorRelation, QgsAttributeEditorAction, QgsAttributeEditorField, QgsAttributeEditorHtmlElement, and QgsAttributeEditorQmlElement.
|
static |
Constructs the editor element from the given element.
Definition at line 58 of file qgsattributeeditorelement.cpp.
QgsAttributeEditorElement::LabelStyle QgsAttributeEditorElement::labelStyle | ( | ) | const |
Returns the label style.
Definition at line 48 of file qgsattributeeditorelement.cpp.
|
inline |
Returns the name of this element.
Definition at line 156 of file qgsattributeeditorelement.h.
|
inline |
Gets the parent of this element.
Definition at line 170 of file qgsattributeeditorelement.h.
void QgsAttributeEditorElement::setLabelStyle | ( | const LabelStyle & | labelStyle | ) |
Sets the labelStyle.
Definition at line 53 of file qgsattributeeditorelement.cpp.
void QgsAttributeEditorElement::setShowLabel | ( | bool | showLabel | ) |
Controls if this element should be labeled with a title (field, relation or groupname).
Definition at line 43 of file qgsattributeeditorelement.cpp.
bool QgsAttributeEditorElement::showLabel | ( | ) | const |
Controls if this element should be labeled with a title (field, relation or groupname).
Definition at line 38 of file qgsattributeeditorelement.cpp.
QDomElement QgsAttributeEditorElement::toDomElement | ( | QDomDocument & | doc | ) | const |
Gets the XML Dom element to save this element.
doc | The QDomDocument which is used to create new XML elements |
Definition at line 28 of file qgsattributeeditorelement.cpp.
|
inline |
The type of this element.
Definition at line 163 of file qgsattributeeditorelement.h.
|
protected |
Definition at line 222 of file qgsattributeeditorelement.h.
|
protected |
Definition at line 219 of file qgsattributeeditorelement.h.
|
protected |
Definition at line 220 of file qgsattributeeditorelement.h.
|
protected |
Definition at line 221 of file qgsattributeeditorelement.h.
|
protected |
Definition at line 218 of file qgsattributeeditorelement.h.