QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
Public Member Functions | List of all members
QgsAttributeEditorAction Class Reference

This element will load a layer action onto the form. More...

#include <qgsattributeeditoraction.h>

Inheritance diagram for QgsAttributeEditorAction:
Inheritance graph
[legend]

Public Member Functions

 QgsAttributeEditorAction (const QgsAction &action, QgsAttributeEditorElement *parent)
 Creates a new element which can display a layer action. More...
 
 QgsAttributeEditorAction (const QUuid &uuid, QgsAttributeEditorElement *parent)
 Creates a new element which can display a layer action, this constructor allows to create a QgsAttributeEditorAction when actions are not yet loaded. More...
 
const QgsActionaction (const QgsVectorLayer *layer) const
 Returns the (possibly lazy loaded) action for the given layer. More...
 
QgsAttributeEditorElementclone (QgsAttributeEditorElement *parent) const override
 Returns a clone of this element. More...
 
void setAction (const QgsAction &newAction)
 Set the action to newAction. More...
 
- Public Member Functions inherited from QgsAttributeEditorElement
 QgsAttributeEditorElement (Qgis::AttributeEditorType type, const QString &name, QgsAttributeEditorElement *parent=nullptr)
 Constructor. More...
 
virtual ~QgsAttributeEditorElement ()=default
 
virtual QgsAttributeEditorElementclone (QgsAttributeEditorElement *parent) const =0
 Returns a clone of this element. More...
 
int horizontalStretch () const
 Returns the horizontal stretch factor for the element. More...
 
LabelStyle labelStyle () const
 Returns the label style. More...
 
QString name () const
 Returns the name of this element. More...
 
QgsAttributeEditorElementparent () const
 Gets the parent of this element. More...
 
void setHorizontalStretch (int stretch)
 Sets the horizontal stretch factor for the 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...
 
void setVerticalStretch (int stretch)
 Sets the vertical stretch factor for the element. 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...
 
Qgis::AttributeEditorType type () const
 The type of this element. More...
 
int verticalStretch () const
 Returns the vertical stretch factor for the element. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from QgsAttributeEditorElement
static QgsAttributeEditorElementcreate (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
int mHorizontalStretch = 0
 
LabelStyle mLabelStyle
 
QString mName
 
QgsAttributeEditorElementmParent = nullptr
 
bool mShowLabel = true
 
Qgis::AttributeEditorType mType = Qgis::AttributeEditorType::Invalid
 
int mVerticalStretch = 0
 

Detailed Description

This element will load a layer action onto the form.

Since
QGIS 3.22

Definition at line 28 of file qgsattributeeditoraction.h.

Constructor & Destructor Documentation

◆ QgsAttributeEditorAction() [1/2]

QgsAttributeEditorAction::QgsAttributeEditorAction ( const QgsAction action,
QgsAttributeEditorElement parent 
)

Creates a new element which can display a layer action.

Parameters
actionThe action
parentThe parent (used as container)

Definition at line 20 of file qgsattributeeditoraction.cpp.

◆ QgsAttributeEditorAction() [2/2]

QgsAttributeEditorAction::QgsAttributeEditorAction ( const QUuid &  uuid,
QgsAttributeEditorElement parent 
)

Creates a new element which can display a layer action, this constructor allows to create a QgsAttributeEditorAction when actions are not yet loaded.

Parameters
uuidThe action unique identifier (UUID).
parentThe parent (used as container).

Definition at line 26 of file qgsattributeeditoraction.cpp.

Member Function Documentation

◆ action()

const QgsAction & QgsAttributeEditorAction::action ( const QgsVectorLayer layer) const

Returns the (possibly lazy loaded) action for the given layer.

Definition at line 39 of file qgsattributeeditoraction.cpp.

◆ clone()

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

Returns a clone of this element.

To be implemented by subclasses.

Implements QgsAttributeEditorElement.

Definition at line 32 of file qgsattributeeditoraction.cpp.

◆ setAction()

void QgsAttributeEditorAction::setAction ( const QgsAction newAction)

Set the action to newAction.

Definition at line 49 of file qgsattributeeditoraction.cpp.


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