An action which can run on map layers The class can be used in two manners:
More...
#include <qgsmaplayeractionregistry.h>
|
| QgsMapLayerAction (const QString &name, QObject *parent, QgsMapLayer *layer, Targets targets=AllActions, const QIcon &icon=QIcon(), QgsMapLayerAction::Flags flags=QgsMapLayerAction::Flags()) |
| Creates a map layer action which can run only on a specific layer. More...
|
|
| QgsMapLayerAction (const QString &name, QObject *parent, QgsMapLayerType layerType, Targets targets=AllActions, const QIcon &icon=QIcon(), QgsMapLayerAction::Flags flags=QgsMapLayerAction::Flags()) |
| Creates a map layer action which can run on a specific type of layer. More...
|
|
| QgsMapLayerAction (const QString &name, QObject *parent, Targets targets=AllActions, const QIcon &icon=QIcon(), QgsMapLayerAction::Flags flags=QgsMapLayerAction::Flags()) |
| Action behavior flags. More...
|
|
| ~QgsMapLayerAction () override |
|
virtual bool | canRunUsingLayer (QgsMapLayer *layer) const |
| True if action can run using the specified layer. More...
|
|
QgsMapLayerAction::Flags | flags () const |
| Layer behavior flags. More...
|
|
bool | isEnabledOnlyWhenEditable () const |
| Returns true if the action is only enabled for layers in editable mode. More...
|
|
void | setTargets (Targets targets) |
| Define the targets of the action. More...
|
|
const Targets & | targets () const |
| Returns availibity of action. More...
|
|
virtual void | triggerForFeature (QgsMapLayer *layer, const QgsFeature &feature) |
| Triggers the action with the specified layer and feature. More...
|
|
virtual void | triggerForFeatures (QgsMapLayer *layer, const QList< QgsFeature > &featureList) |
| Triggers the action with the specified layer and list of feature. More...
|
|
virtual void | triggerForLayer (QgsMapLayer *layer) |
| Triggers the action with the specified layer. More...
|
|
An action which can run on map layers The class can be used in two manners:
- by instantiating it and connecting to its signals to perform an action
- by subclassing and reimplementing its method (only since QGIS 3.18.2)
Definition at line 38 of file qgsmaplayeractionregistry.h.
◆ Flag
Flags which control action behavior /since QGIS 3.0.
Enumerator |
---|
EnabledOnlyWhenEditable | Action should be shown only for editable layers.
|
Definition at line 57 of file qgsmaplayeractionregistry.h.
◆ Target
◆ QgsMapLayerAction() [1/3]
QgsMapLayerAction::QgsMapLayerAction |
( |
const QString & |
name, |
|
|
QObject * |
parent, |
|
|
Targets |
targets = AllActions , |
|
|
const QIcon & |
icon = QIcon() , |
|
|
QgsMapLayerAction::Flags |
flags = QgsMapLayerAction::Flags() |
|
) |
| |
Action behavior flags.
- Since
- QGIS 3.0 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 20 of file qgsmaplayeractionregistry.cpp.
◆ QgsMapLayerAction() [2/3]
QgsMapLayerAction::QgsMapLayerAction |
( |
const QString & |
name, |
|
|
QObject * |
parent, |
|
|
QgsMapLayer * |
layer, |
|
|
Targets |
targets = AllActions , |
|
|
const QIcon & |
icon = QIcon() , |
|
|
QgsMapLayerAction::Flags |
flags = QgsMapLayerAction::Flags() |
|
) |
| |
◆ QgsMapLayerAction() [3/3]
QgsMapLayerAction::QgsMapLayerAction |
( |
const QString & |
name, |
|
|
QObject * |
parent, |
|
|
QgsMapLayerType |
layerType, |
|
|
Targets |
targets = AllActions , |
|
|
const QIcon & |
icon = QIcon() , |
|
|
QgsMapLayerAction::Flags |
flags = QgsMapLayerAction::Flags() |
|
) |
| |
◆ ~QgsMapLayerAction()
QgsMapLayerAction::~QgsMapLayerAction |
( |
| ) |
|
|
override |
◆ canRunUsingLayer()
bool QgsMapLayerAction::canRunUsingLayer |
( |
QgsMapLayer * |
layer | ) |
const |
|
virtual |
◆ flags()
QgsMapLayerAction::Flags QgsMapLayerAction::flags |
( |
| ) |
const |
◆ isEnabledOnlyWhenEditable()
bool QgsMapLayerAction::isEnabledOnlyWhenEditable |
( |
| ) |
const |
◆ setTargets()
void QgsMapLayerAction::setTargets |
( |
Targets |
targets | ) |
|
|
inline |
◆ targets()
const Targets & QgsMapLayerAction::targets |
( |
| ) |
const |
|
inline |
◆ triggeredForFeature
Triggered when action has been run for a specific feature.
◆ triggeredForFeatures
void QgsMapLayerAction::triggeredForFeatures |
( |
QgsMapLayer * |
layer, |
|
|
const QList< QgsFeature > & |
featureList |
|
) |
| |
|
signal |
Triggered when action has been run for a specific list of features.
◆ triggeredForLayer
void QgsMapLayerAction::triggeredForLayer |
( |
QgsMapLayer * |
layer | ) |
|
|
signal |
Triggered when action has been run for a specific layer.
◆ triggerForFeature()
◆ triggerForFeatures()
void QgsMapLayerAction::triggerForFeatures |
( |
QgsMapLayer * |
layer, |
|
|
const QList< QgsFeature > & |
featureList |
|
) |
| |
|
virtual |
◆ triggerForLayer()
void QgsMapLayerAction::triggerForLayer |
( |
QgsMapLayer * |
layer | ) |
|
|
virtual |
The documentation for this class was generated from the following files: