QGIS API Documentation  3.14.0-Pi (9f7028fd23)
Public Member Functions | List of all members
QgsAttributeEditorRelation Class Reference

#include <qgsattributeeditorelement.h>

Inheritance diagram for QgsAttributeEditorRelation:
Inheritance graph
[legend]

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...
 
QgsAttributeEditorElementclone (QgsAttributeEditorElement *parent) const override
 Returns a clone of this element. More...
 
bool init (QgsRelationManager *relManager)
 Initializes the relation from the id. More...
 
const QgsRelationrelation () const
 Gets the id of the relation which shall be embedded. More...
 
void setShowLinkButton (bool showLinkButton)
 Determines if the "link feature" button should be shown. More...
 
void setShowSaveChildEditsButton (bool showSaveChildEditsButton)
 Determines if the "save child layer edits" button should be shown. More...
 
void setShowUnlinkButton (bool showUnlinkButton)
 Determines if the "unlink feature" button should be shown. More...
 
bool showLinkButton () const
 Determines if the "link feature" button should be shown. More...
 
bool showSaveChildEditsButton () const
 Returns true if the "save child layer edits" button should be shown. More...
 
bool showUnlinkButton () const
 Determines if the "unlink feature" button should be shown. More...
 
- Public Member Functions inherited from QgsAttributeEditorElement
 QgsAttributeEditorElement (AttributeEditorType type, const QString &name, QgsAttributeEditorElement *parent=nullptr)
 Constructor. More...
 
virtual ~QgsAttributeEditorElement ()=default
 
QString name () const
 Returns the name of this element. More...
 
QgsAttributeEditorElementparent () const
 Gets the parent of this element. 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

- Public Types inherited from QgsAttributeEditorElement
enum  AttributeEditorType {
  AeTypeContainer, AeTypeField, AeTypeRelation, AeTypeInvalid,
  AeTypeQmlElement, AeTypeHtmlElement
}
 
- Protected Attributes inherited from QgsAttributeEditorElement
QString mName
 
QgsAttributeEditorElementmParent = nullptr
 
bool mShowLabel
 
AttributeEditorType mType
 

Detailed Description

This element will load a relation editor onto the form.

Definition at line 333 of file qgsattributeeditorelement.h.

Constructor & Destructor Documentation

◆ QgsAttributeEditorRelation() [1/4]

Q_DECL_DEPRECATED QgsAttributeEditorRelation::QgsAttributeEditorRelation ( const QString &  name,
const QString &  relationId,
QgsAttributeEditorElement parent 
)
inline
Deprecated:
since QGIS 3.0.2.

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

Definition at line 340 of file qgsattributeeditorelement.h.

◆ QgsAttributeEditorRelation() [2/4]

Q_DECL_DEPRECATED QgsAttributeEditorRelation::QgsAttributeEditorRelation ( const QString &  name,
const QgsRelation relation,
QgsAttributeEditorElement parent 
)
inline
Deprecated:
since QGIS 3.0.2.

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

Definition at line 348 of file qgsattributeeditorelement.h.

◆ QgsAttributeEditorRelation() [3/4]

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

Creates a new element which embeds a relation.

Parameters
relationIdThe id of the relation to embed
parentThe parent (used as container)

Definition at line 360 of file qgsattributeeditorelement.h.

◆ QgsAttributeEditorRelation() [4/4]

QgsAttributeEditorRelation::QgsAttributeEditorRelation ( const QgsRelation relation,
QgsAttributeEditorElement parent 
)
inline

Creates a new element which embeds a relation.

Parameters
relationThe relation to embed
parentThe parent (used as container)

Definition at line 371 of file qgsattributeeditorelement.h.

Member Function Documentation

◆ clone()

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

Returns a clone of this element.

To be implemented by subclasses.

Since
QGIS 3.0

Implements QgsAttributeEditorElement.

Definition at line 95 of file qgsattributeeditorelement.cpp.

◆ init()

bool QgsAttributeEditorRelation::init ( QgsRelationManager relManager)

Initializes the relation from the id.

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

Definition at line 89 of file qgsattributeeditorelement.cpp.

◆ relation()

const QgsRelation& QgsAttributeEditorRelation::relation ( ) const
inline

Gets the id of the relation which shall be embedded.

Returns
the id

Definition at line 383 of file qgsattributeeditorelement.h.

◆ setShowLinkButton()

void QgsAttributeEditorRelation::setShowLinkButton ( bool  showLinkButton)

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

Since
QGIS 2.18

Definition at line 151 of file qgsattributeeditorelement.cpp.

◆ setShowSaveChildEditsButton()

void QgsAttributeEditorRelation::setShowSaveChildEditsButton ( bool  showSaveChildEditsButton)

Determines if the "save child layer edits" button should be shown.

Since
QGIS 3.14

Definition at line 166 of file qgsattributeeditorelement.cpp.

◆ setShowUnlinkButton()

void QgsAttributeEditorRelation::setShowUnlinkButton ( bool  showUnlinkButton)

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

Since
QGIS 2.18

Definition at line 161 of file qgsattributeeditorelement.cpp.

◆ showLinkButton()

bool QgsAttributeEditorRelation::showLinkButton ( ) const

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

Since
QGIS 2.18

Definition at line 146 of file qgsattributeeditorelement.cpp.

◆ showSaveChildEditsButton()

bool QgsAttributeEditorRelation::showSaveChildEditsButton ( ) const

Returns true if the "save child layer edits" button should be shown.

Since
QGIS 3.14

Definition at line 171 of file qgsattributeeditorelement.cpp.

◆ showUnlinkButton()

bool QgsAttributeEditorRelation::showUnlinkButton ( ) const

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

Since
QGIS 2.18

Definition at line 156 of file qgsattributeeditorelement.cpp.


The documentation for this class was generated from the following files: