QgsAttributeEditorRelation class

This element will load a relation editor onto the form.

Base classes

class QgsAttributeEditorElement
This is an abstract base class for any elements of a drag and drop form.

Constructors, destructors, conversion operators

QgsAttributeEditorRelation(const QString& relationId, QgsAttributeEditorElement* parent)
Creates a new element which embeds a relation.
QgsAttributeEditorRelation(const QgsRelation& relation, QgsAttributeEditorElement* parent)
Creates a new element which embeds a relation.

Public functions

auto QgsAttributeEditorRelation(const QString& name, const QString& relationId, QgsAttributeEditorElement* parent) -> Q_DECL_DEPRECATED deprecated
auto QgsAttributeEditorRelation(const QString& name, const QgsRelation& relation, QgsAttributeEditorElement* parent) -> Q_DECL_DEPRECATED deprecated
auto clone(QgsAttributeEditorElement* parent) const -> QgsAttributeEditorElement* override
Returns a clone of this element.
auto init(QgsRelationManager* relManager) -> bool
Initializes the relation from the id.
auto relation() const -> const QgsRelation&
Gets the id of the relation which shall be embedded.
void setShowLinkButton(bool showLinkButton)
Determines if the "link feature" button should be shown.
void setShowUnlinkButton(bool showUnlinkButton)
Determines if the "unlink feature" button should be shown.
auto showLinkButton() const -> bool
Determines if the "link feature" button should be shown.
auto showUnlinkButton() const -> bool
Determines if the "unlink feature" button should be shown.

Private functions

void saveConfiguration(QDomElement& elem) const override
Should be implemented by subclasses to save type specific configuration.
auto typeIdentifier() const -> QString override
All subclasses need to overwrite this method and return a type specific identifier.

Function documentation

QgsAttributeEditorRelation::QgsAttributeEditorRelation(const QString& relationId, QgsAttributeEditorElement* parent)

Creates a new element which embeds a relation.

Parameters
relationId The id of the relation to embed
parent The parent (used as container)

QgsAttributeEditorRelation::QgsAttributeEditorRelation(const QgsRelation& relation, QgsAttributeEditorElement* parent)

Creates a new element which embeds a relation.

Parameters
relation The relation to embed
parent The parent (used as container)

Q_DECL_DEPRECATED QgsAttributeEditorRelation::QgsAttributeEditorRelation(const QString& name, const QString& relationId, QgsAttributeEditorElement* parent)

The name parameter is not used for anything and overwritten by the relationId internally.

Q_DECL_DEPRECATED QgsAttributeEditorRelation::QgsAttributeEditorRelation(const QString& name, const QgsRelation& relation, QgsAttributeEditorElement* parent)

The name parameter is not used for anything and overwritten by the relationId internally.

QgsAttributeEditorElement* QgsAttributeEditorRelation::clone(QgsAttributeEditorElement* parent) const override

Returns a clone of this element.

To be implemented by subclasses.

bool QgsAttributeEditorRelation::init(QgsRelationManager* relManager)

Initializes the relation from the id.

Parameters
relManager The relation manager to use for the initialization
Returns true if the relation was found in the relationmanager

const QgsRelation& QgsAttributeEditorRelation::relation() const

Gets the id of the relation which shall be embedded.

Returns the id

void QgsAttributeEditorRelation::setShowLinkButton(bool showLinkButton)

Determines if the "link feature" button should be shown.

void QgsAttributeEditorRelation::setShowUnlinkButton(bool showUnlinkButton)

Determines if the "unlink feature" button should be shown.

bool QgsAttributeEditorRelation::showLinkButton() const

Determines if the "link feature" button should be shown.

bool QgsAttributeEditorRelation::showUnlinkButton() const

Determines if the "unlink feature" button should be shown.

void QgsAttributeEditorRelation::saveConfiguration(QDomElement& elem) const override private

Should be implemented by subclasses to save type specific configuration.

QString QgsAttributeEditorRelation::typeIdentifier() const override private

All subclasses need to overwrite this method and return a type specific identifier.

Needs to be XML key compatible.