QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
Loading...
Searching...
No Matches
Signals | Public Member Functions | List of all members
QgsMapLayerAction Class Reference

An action which can run on map layers The class can be used in two manners: More...

#include <qgsmaplayeraction.h>

Inheritance diagram for QgsMapLayerAction:
Inheritance graph
[legend]

Signals

Q_DECL_DEPRECATED void triggeredForFeature (QgsMapLayer *layer, const QgsFeature &feature)
 Triggered when action has been run for a specific feature.
 
Q_DECL_DEPRECATED void triggeredForFeatures (QgsMapLayer *layer, const QList< QgsFeature > &featureList)
 Triggered when action has been run for a specific list of features.
 
void triggeredForFeaturesV2 (QgsMapLayer *layer, const QList< QgsFeature > &featureList, const QgsMapLayerActionContext &context)
 Triggered when action has been run for a specific list of features.
 
void triggeredForFeatureV2 (QgsMapLayer *layer, const QgsFeature &feature, const QgsMapLayerActionContext &context)
 Triggered when action has been run for a specific feature.
 
Q_DECL_DEPRECATED void triggeredForLayer (QgsMapLayer *layer)
 Triggered when action has been run for a specific layer.
 
void triggeredForLayerV2 (QgsMapLayer *layer, const QgsMapLayerActionContext &context)
 Triggered when action has been run for a specific layer.
 

Public Member Functions

 QgsMapLayerAction (const QString &name, QObject *parent, Qgis::LayerType layerType, Qgis::MapLayerActionTargets targets=Qgis::MapLayerActionTarget::AllActions, const QIcon &icon=QIcon(), Qgis::MapLayerActionFlags flags=Qgis::MapLayerActionFlags())
 Creates a map layer action which can run on a specific type of layer.
 
 QgsMapLayerAction (const QString &name, QObject *parent, Qgis::MapLayerActionTargets targets=Qgis::MapLayerActionTarget::AllActions, const QIcon &icon=QIcon(), Qgis::MapLayerActionFlags flags=Qgis::MapLayerActionFlags())
 Creates a map layer action which can run on any layer.
 
 QgsMapLayerAction (const QString &name, QObject *parent, QgsMapLayer *layer, Qgis::MapLayerActionTargets targets=Qgis::MapLayerActionTarget::AllActions, const QIcon &icon=QIcon(), Qgis::MapLayerActionFlags flags=Qgis::MapLayerActionFlags())
 Creates a map layer action which can run only on a specific layer.
 
 ~QgsMapLayerAction () override
 
virtual Q_DECL_DEPRECATED bool canRunUsingLayer (QgsMapLayer *layer) const
 Returns true if the action can run using the specified layer.
 
virtual bool canRunUsingLayer (QgsMapLayer *layer, const QgsMapLayerActionContext &context) const
 Returns true if the action can run using the specified layer.
 
Qgis::MapLayerActionFlags flags () const
 Layer behavior flags.
 
bool isEnabledOnlyWhenEditable () const
 Returns true if the action is only enabled for layers in editable mode.
 
void setTargets (Qgis::MapLayerActionTargets targets)
 Define the targets of the action.
 
Qgis::MapLayerActionTargets targets () const
 Returns availibity of action.
 
virtual Q_DECL_DEPRECATED void triggerForFeature (QgsMapLayer *layer, const QgsFeature &feature)
 Triggers the action with the specified layer and feature.
 
virtual void triggerForFeature (QgsMapLayer *layer, const QgsFeature &feature, const QgsMapLayerActionContext &context)
 Triggers the action with the specified layer and feature.
 
virtual Q_DECL_DEPRECATED void triggerForFeatures (QgsMapLayer *layer, const QList< QgsFeature > &featureList)
 Triggers the action with the specified layer and list of feature.
 
virtual void triggerForFeatures (QgsMapLayer *layer, const QList< QgsFeature > &featureList, const QgsMapLayerActionContext &context)
 Triggers the action with the specified layer and list of feature.
 
virtual Q_DECL_DEPRECATED void triggerForLayer (QgsMapLayer *layer)
 Triggers the action with the specified layer.
 
virtual void triggerForLayer (QgsMapLayer *layer, const QgsMapLayerActionContext &context)
 Triggers the action with the specified layer.
 

Detailed Description

An action which can run on map layers The class can be used in two manners:

Definition at line 41 of file qgsmaplayeraction.h.

Constructor & Destructor Documentation

◆ QgsMapLayerAction() [1/3]

QgsMapLayerAction::QgsMapLayerAction ( const QString &  name,
QObject *  parent,
Qgis::MapLayerActionTargets  targets = Qgis::MapLayerActionTarget::AllActions,
const QIcon &  icon = QIcon(),
Qgis::MapLayerActionFlags  flags = Qgis::MapLayerActionFlags() 
)

Creates a map layer action which can run on any layer.

Note
using AllActions as a target probably does not make a lot of sense. This default action was settled for API compatibility reasons.

Definition at line 23 of file qgsmaplayeraction.cpp.

◆ QgsMapLayerAction() [2/3]

QgsMapLayerAction::QgsMapLayerAction ( const QString &  name,
QObject *  parent,
QgsMapLayer layer,
Qgis::MapLayerActionTargets  targets = Qgis::MapLayerActionTarget::AllActions,
const QIcon &  icon = QIcon(),
Qgis::MapLayerActionFlags  flags = Qgis::MapLayerActionFlags() 
)

Creates a map layer action which can run only on a specific layer.

Definition at line 30 of file qgsmaplayeraction.cpp.

◆ QgsMapLayerAction() [3/3]

QgsMapLayerAction::QgsMapLayerAction ( const QString &  name,
QObject *  parent,
Qgis::LayerType  layerType,
Qgis::MapLayerActionTargets  targets = Qgis::MapLayerActionTarget::AllActions,
const QIcon &  icon = QIcon(),
Qgis::MapLayerActionFlags  flags = Qgis::MapLayerActionFlags() 
)

Creates a map layer action which can run on a specific type of layer.

Definition at line 39 of file qgsmaplayeraction.cpp.

◆ ~QgsMapLayerAction()

QgsMapLayerAction::~QgsMapLayerAction ( )
override

Definition at line 48 of file qgsmaplayeraction.cpp.

Member Function Documentation

◆ canRunUsingLayer() [1/2]

bool QgsMapLayerAction::canRunUsingLayer ( QgsMapLayer layer) const
virtual

Returns true if the action can run using the specified layer.

Deprecated:
QGIS 3.40. Use the version with QgsMapLayerActionContext instead.

Definition at line 59 of file qgsmaplayeraction.cpp.

◆ canRunUsingLayer() [2/2]

bool QgsMapLayerAction::canRunUsingLayer ( QgsMapLayer layer,
const QgsMapLayerActionContext context 
) const
virtual

Returns true if the action can run using the specified layer.

Note
Classes which implement this should return false to the deprecated canRunUsingLayer() method which does not accept a QgsMapLayerActionContext argument.
Since
QGIS 3.30

Definition at line 64 of file qgsmaplayeraction.cpp.

◆ flags()

Qgis::MapLayerActionFlags QgsMapLayerAction::flags ( ) const

Layer behavior flags.

Definition at line 54 of file qgsmaplayeraction.cpp.

◆ isEnabledOnlyWhenEditable()

bool QgsMapLayerAction::isEnabledOnlyWhenEditable ( ) const

Returns true if the action is only enabled for layers in editable mode.

Definition at line 134 of file qgsmaplayeraction.cpp.

◆ setTargets()

void QgsMapLayerAction::setTargets ( Qgis::MapLayerActionTargets  targets)
inline

Define the targets of the action.

Definition at line 125 of file qgsmaplayeraction.h.

◆ targets()

Qgis::MapLayerActionTargets QgsMapLayerAction::targets ( ) const
inline

Returns availibity of action.

Definition at line 127 of file qgsmaplayeraction.h.

◆ triggeredForFeature

Q_DECL_DEPRECATED void QgsMapLayerAction::triggeredForFeature ( QgsMapLayer layer,
const QgsFeature feature 
)
signal

Triggered when action has been run for a specific feature.

Deprecated:
QGIS 3.40. Use the version with QgsMapLayerActionContext instead.

◆ triggeredForFeatures

Q_DECL_DEPRECATED void QgsMapLayerAction::triggeredForFeatures ( QgsMapLayer layer,
const QList< QgsFeature > &  featureList 
)
signal

Triggered when action has been run for a specific list of features.

Deprecated:
QGIS 3.40. Use the version with QgsMapLayerActionContext instead.

◆ triggeredForFeaturesV2

void QgsMapLayerAction::triggeredForFeaturesV2 ( QgsMapLayer layer,
const QList< QgsFeature > &  featureList,
const QgsMapLayerActionContext context 
)
signal

Triggered when action has been run for a specific list of features.

Since
QGIS 3.30

◆ triggeredForFeatureV2

void QgsMapLayerAction::triggeredForFeatureV2 ( QgsMapLayer layer,
const QgsFeature feature,
const QgsMapLayerActionContext context 
)
signal

Triggered when action has been run for a specific feature.

Since
QGIS 3.30

◆ triggeredForLayer

Q_DECL_DEPRECATED void QgsMapLayerAction::triggeredForLayer ( QgsMapLayer layer)
signal

Triggered when action has been run for a specific layer.

Deprecated:
QGIS 3.40. Use the version with QgsMapLayerActionContext instead.

◆ triggeredForLayerV2

void QgsMapLayerAction::triggeredForLayerV2 ( QgsMapLayer layer,
const QgsMapLayerActionContext context 
)
signal

Triggered when action has been run for a specific layer.

Since
QGIS 3.30

◆ triggerForFeature() [1/2]

void QgsMapLayerAction::triggerForFeature ( QgsMapLayer layer,
const QgsFeature feature 
)
virtual

Triggers the action with the specified layer and feature.

Deprecated:
QGIS 3.40. Use the version with QgsMapLayerActionContext instead.

Definition at line 105 of file qgsmaplayeraction.cpp.

◆ triggerForFeature() [2/2]

void QgsMapLayerAction::triggerForFeature ( QgsMapLayer layer,
const QgsFeature feature,
const QgsMapLayerActionContext context 
)
virtual

Triggers the action with the specified layer and feature.

Since
QGIS 3.30

Definition at line 124 of file qgsmaplayeraction.cpp.

◆ triggerForFeatures() [1/2]

void QgsMapLayerAction::triggerForFeatures ( QgsMapLayer layer,
const QList< QgsFeature > &  featureList 
)
virtual

Triggers the action with the specified layer and list of feature.

Deprecated:
QGIS 3.40. Use the version with QgsMapLayerActionContext instead.

Definition at line 98 of file qgsmaplayeraction.cpp.

◆ triggerForFeatures() [2/2]

void QgsMapLayerAction::triggerForFeatures ( QgsMapLayer layer,
const QList< QgsFeature > &  featureList,
const QgsMapLayerActionContext context 
)
virtual

Triggers the action with the specified layer and list of feature.

Since
QGIS 3.30

Definition at line 119 of file qgsmaplayeraction.cpp.

◆ triggerForLayer() [1/2]

void QgsMapLayerAction::triggerForLayer ( QgsMapLayer layer)
virtual

Triggers the action with the specified layer.

Deprecated:
QGIS 3.40. Use the version with QgsMapLayerActionContext instead.

Definition at line 112 of file qgsmaplayeraction.cpp.

◆ triggerForLayer() [2/2]

void QgsMapLayerAction::triggerForLayer ( QgsMapLayer layer,
const QgsMapLayerActionContext context 
)
virtual

Triggers the action with the specified layer.

Since
QGIS 3.30

Definition at line 129 of file qgsmaplayeraction.cpp.


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