QGIS API Documentation 3.41.0-Master (af5edcb665c)
|
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 Member Functions | |
QgsAttributeEditorElement (Qgis::AttributeEditorType type, const QString &name, QgsAttributeEditorElement *parent=nullptr) | |
Constructor. | |
virtual | ~QgsAttributeEditorElement ()=default |
virtual QgsAttributeEditorElement * | clone (QgsAttributeEditorElement *parent) const =0 |
Returns a clone of this element. | |
int | horizontalStretch () const |
Returns the horizontal stretch factor for the element. | |
LabelStyle | labelStyle () const |
Returns the label style. | |
QString | name () const |
Returns the name of this element. | |
QgsAttributeEditorElement * | parent () const |
Gets the parent of this element. | |
void | setHorizontalStretch (int stretch) |
Sets the horizontal stretch factor for the element. | |
void | setLabelStyle (const LabelStyle &labelStyle) |
Sets the labelStyle. | |
void | setShowLabel (bool showLabel) |
Controls if this element should be labeled with a title (field, relation or groupname). | |
void | setVerticalStretch (int stretch) |
Sets the vertical stretch factor for the element. | |
bool | showLabel () const |
Controls if this element should be labeled with a title (field, relation or groupname). | |
QDomElement | toDomElement (QDomDocument &doc) const |
Gets the XML Dom element to save this element. | |
Qgis::AttributeEditorType | type () const |
The type of this element. | |
int | verticalStretch () const |
Returns the vertical stretch factor for the element. | |
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. | |
Protected Attributes | |
int | mHorizontalStretch = 0 |
LabelStyle | mLabelStyle |
QString | mName |
QgsAttributeEditorElement * | mParent = nullptr |
bool | mShowLabel = true |
Qgis::AttributeEditorType | mType = Qgis::AttributeEditorType::Invalid |
int | mVerticalStretch = 0 |
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 42 of file qgsattributeeditorelement.h.
|
inline |
Constructor.
type | The type of the new element. |
name | |
parent |
Definition at line 114 of file qgsattributeeditorelement.h.
|
virtualdefault |
|
pure virtual |
Returns a clone of this element.
To be implemented by subclasses.
Implemented in QgsAttributeEditorAction, QgsAttributeEditorContainer, QgsAttributeEditorField, QgsAttributeEditorHtmlElement, QgsAttributeEditorQmlElement, QgsAttributeEditorRelation, QgsAttributeEditorSpacerElement, and QgsAttributeEditorTextElement.
|
static |
Constructs the editor element from the given element.
Definition at line 62 of file qgsattributeeditorelement.cpp.
|
inline |
Returns the horizontal stretch factor for the element.
Definition at line 183 of file qgsattributeeditorelement.h.
QgsAttributeEditorElement::LabelStyle QgsAttributeEditorElement::labelStyle | ( | ) | const |
Returns the label style.
Definition at line 52 of file qgsattributeeditorelement.cpp.
|
inline |
Returns the name of this element.
Definition at line 134 of file qgsattributeeditorelement.h.
|
inline |
Gets the parent of this element.
Definition at line 147 of file qgsattributeeditorelement.h.
|
inline |
Sets the horizontal stretch factor for the element.
Definition at line 193 of file qgsattributeeditorelement.h.
void QgsAttributeEditorElement::setLabelStyle | ( | const LabelStyle & | labelStyle | ) |
Sets the labelStyle.
Definition at line 57 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 47 of file qgsattributeeditorelement.cpp.
|
inline |
Sets the vertical stretch factor for the element.
Definition at line 213 of file qgsattributeeditorelement.h.
bool QgsAttributeEditorElement::showLabel | ( | ) | const |
Controls if this element should be labeled with a title (field, relation or groupname).
Definition at line 42 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 30 of file qgsattributeeditorelement.cpp.
|
inline |
The type of this element.
Definition at line 141 of file qgsattributeeditorelement.h.
|
inline |
Returns the vertical stretch factor for the element.
Definition at line 203 of file qgsattributeeditorelement.h.
|
protected |
Definition at line 236 of file qgsattributeeditorelement.h.
|
protected |
Definition at line 238 of file qgsattributeeditorelement.h.
|
protected |
Definition at line 233 of file qgsattributeeditorelement.h.
|
protected |
Definition at line 234 of file qgsattributeeditorelement.h.
|
protected |
Definition at line 235 of file qgsattributeeditorelement.h.
|
protected |
Definition at line 232 of file qgsattributeeditorelement.h.
|
protected |
Definition at line 237 of file qgsattributeeditorelement.h.