QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
|
This element will load a relation editor onto the form. More...
#include <qgsattributeeditorrelation.h>
Public Types | |
enum | Button { Link = 1 << 1 , Unlink = 1 << 2 , SaveChildEdits = 1 << 3 , AddChildFeature = 1 << 4 , DuplicateChildFeature = 1 << 5 , DeleteChildFeature = 1 << 6 , ZoomToChildFeature = 1 << 7 , AllButtons = Link | Unlink | SaveChildEdits | AddChildFeature | DuplicateChildFeature | DeleteChildFeature | ZoomToChildFeature } |
Possible buttons shown in the relation editor. More... | |
Public Types inherited from QgsAttributeEditorElement | |
enum | AttributeEditorType { AeTypeContainer , AeTypeField , AeTypeRelation , AeTypeInvalid , AeTypeQmlElement , AeTypeHtmlElement , AeTypeAction } |
Public Member Functions | |
QgsAttributeEditorRelation (const QgsRelation &relation, QgsAttributeEditorElement *parent) | |
Creates a new element which embeds a relation. More... | |
Q_DECL_DEPRECATED | QgsAttributeEditorRelation (const QString &name, const QgsRelation &relation, QgsAttributeEditorElement *parent) |
Q_DECL_DEPRECATED | QgsAttributeEditorRelation (const QString &name, const QString &relationId, QgsAttributeEditorElement *parent) |
QgsAttributeEditorRelation (const QString &relationId, QgsAttributeEditorElement *parent) | |
Creates a new element which embeds a relation. More... | |
QgsAttributeEditorElement * | clone (QgsAttributeEditorElement *parent) const override |
Returns a clone of this element. More... | |
bool | forceSuppressFormPopup () const |
Determines the force suppress form popup status. More... | |
bool | init (QgsRelationManager *relManager) |
Initializes the relation from the id. More... | |
QString | label () const |
Determines the label of this element. More... | |
QVariant | nmRelationId () const |
Determines the relation id of the second relation involved in an N:M relation. More... | |
const QgsRelation & | relation () const |
Gets the id of the relation which shall be embedded. More... | |
QVariantMap | relationEditorConfiguration () const |
Returns the relation editor widget configuration. More... | |
QString | relationWidgetTypeId () const |
Returns the current relation widget type id. More... | |
void | setForceSuppressFormPopup (bool forceSuppressFormPopup) |
Sets force suppress form popup status to forceSuppressFormPopup. More... | |
void | setLabel (const QString &label=QString()) |
Sets label for this element If it's empty it takes the relation id as label. More... | |
void | setNmRelationId (const QVariant &nmRelationId=QVariant()) |
Sets nmRelationId for the relation id of the second relation involved in an N:M relation. More... | |
void | setRelationEditorConfiguration (const QVariantMap &config) |
Sets the relation editor configuration. More... | |
void | setRelationWidgetTypeId (const QString &relationWidgetTypeId) |
Sets the relation widget type. More... | |
Public Member Functions inherited from QgsAttributeEditorElement | |
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... | |
Additional Inherited Members | |
Static Public Member Functions inherited from QgsAttributeEditorElement | |
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 inherited from QgsAttributeEditorElement | |
LabelStyle | mLabelStyle |
QString | mName |
QgsAttributeEditorElement * | mParent = nullptr |
bool | mShowLabel |
AttributeEditorType | mType |
This element will load a relation editor onto the form.
Definition at line 32 of file qgsattributeeditorrelation.h.
Possible buttons shown in the relation editor.
Definition at line 42 of file qgsattributeeditorrelation.h.
|
inline |
Definition at line 63 of file qgsattributeeditorrelation.h.
|
inline |
Definition at line 71 of file qgsattributeeditorrelation.h.
|
inline |
Creates a new element which embeds a relation.
relationId | The id of the relation to embed |
parent | The parent (used as container) |
Definition at line 83 of file qgsattributeeditorrelation.h.
|
inline |
Creates a new element which embeds a relation.
relation | The relation to embed |
parent | The parent (used as container) |
Definition at line 94 of file qgsattributeeditorrelation.h.
|
overridevirtual |
Returns a clone of this element.
To be implemented by subclasses.
Implements QgsAttributeEditorElement.
Definition at line 26 of file qgsattributeeditorrelation.cpp.
bool QgsAttributeEditorRelation::forceSuppressFormPopup | ( | ) | const |
Determines the force suppress form popup status.
Definition at line 124 of file qgsattributeeditorrelation.cpp.
bool QgsAttributeEditorRelation::init | ( | QgsRelationManager * | relManager | ) |
Initializes the relation from the id.
relManager | The relation manager to use for the initialization |
true
if the relation was found in the relationmanager Definition at line 20 of file qgsattributeeditorrelation.cpp.
QString QgsAttributeEditorRelation::label | ( | ) | const |
Determines the label of this element.
Definition at line 144 of file qgsattributeeditorrelation.cpp.
QVariant QgsAttributeEditorRelation::nmRelationId | ( | ) | const |
Determines the relation id of the second relation involved in an N:M relation.
Definition at line 134 of file qgsattributeeditorrelation.cpp.
|
inline |
Gets the id of the relation which shall be embedded.
Definition at line 106 of file qgsattributeeditorrelation.h.
QVariantMap QgsAttributeEditorRelation::relationEditorConfiguration | ( | ) | const |
Returns the relation editor widget configuration.
Definition at line 159 of file qgsattributeeditorrelation.cpp.
QString QgsAttributeEditorRelation::relationWidgetTypeId | ( | ) | const |
Returns the current relation widget type id.
Definition at line 149 of file qgsattributeeditorrelation.cpp.
void QgsAttributeEditorRelation::setForceSuppressFormPopup | ( | bool | forceSuppressFormPopup | ) |
Sets force suppress form popup status to forceSuppressFormPopup.
This flag is to override the layer and general settings regarding the automatic opening of the attribute form dialog when digitizing is completed.
Definition at line 119 of file qgsattributeeditorrelation.cpp.
void QgsAttributeEditorRelation::setLabel | ( | const QString & | label = QString() | ) |
Sets label for this element If it's empty it takes the relation id as label.
Definition at line 139 of file qgsattributeeditorrelation.cpp.
void QgsAttributeEditorRelation::setNmRelationId | ( | const QVariant & | nmRelationId = QVariant() | ) |
Sets nmRelationId for the relation id of the second relation involved in an N:M relation.
If it's empty, then it's considered as a 1:M relationship.
Definition at line 129 of file qgsattributeeditorrelation.cpp.
void QgsAttributeEditorRelation::setRelationEditorConfiguration | ( | const QVariantMap & | config | ) |
Sets the relation editor configuration.
Definition at line 164 of file qgsattributeeditorrelation.cpp.
void QgsAttributeEditorRelation::setRelationWidgetTypeId | ( | const QString & | relationWidgetTypeId | ) |
Sets the relation widget type.
Definition at line 154 of file qgsattributeeditorrelation.cpp.