QGIS API Documentation  2.99.0-Master (7705179)
Public Types | Signals | Public Member Functions | List of all members
QgsMapLayerAction Class Reference

An action which can run on map layers. More...

#include <qgsmaplayeractionregistry.h>

Inheritance diagram for QgsMapLayerAction:
Inheritance graph
[legend]

Public Types

enum  Target { Layer = 1, SingleFeature = 2, MultipleFeatures = 4, AllActions = Layer | SingleFeature | MultipleFeatures }
 

Signals

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

Public Member Functions

 QgsMapLayerAction (const QString &name, QObject *parent, Targets targets=AllActions, const QIcon &icon=QIcon())
 Creates a map layer action which can run on any layer. More...
 
 QgsMapLayerAction (const QString &name, QObject *parent, QgsMapLayer *layer, Targets targets=AllActions, const QIcon &icon=QIcon())
 Creates a map layer action which can run only on a specific layer. More...
 
 QgsMapLayerAction (const QString &name, QObject *parent, QgsMapLayer::LayerType layerType, Targets targets=AllActions, const QIcon &icon=QIcon())
 Creates a map layer action which can run on a specific type of layer. More...
 
 ~QgsMapLayerAction ()
 
bool canRunUsingLayer (QgsMapLayer *layer) const
 True if action can run using the specified layer. More...
 
void setTargets (Targets targets)
 Define the targets of the action. More...
 
const Targets & targets () const
 Return availibity of action. More...
 
void triggerForFeature (QgsMapLayer *layer, const QgsFeature *feature)
 Triggers the action with the specified layer and feature. More...
 
void triggerForFeatures (QgsMapLayer *layer, const QList< QgsFeature > &featureList)
 Triggers the action with the specified layer and list of feature. More...
 
void triggerForLayer (QgsMapLayer *layer)
 Triggers the action with the specified layer. More...
 

Detailed Description

An action which can run on map layers.

Definition at line 33 of file qgsmaplayeractionregistry.h.

Member Enumeration Documentation

◆ Target

Enumerator
Layer 
SingleFeature 
MultipleFeatures 
AllActions 

Definition at line 39 of file qgsmaplayeractionregistry.h.

Constructor & Destructor Documentation

◆ QgsMapLayerAction() [1/3]

QgsMapLayerAction::QgsMapLayerAction ( const QString &  name,
QObject *  parent,
Targets  targets = AllActions,
const QIcon &  icon = QIcon() 
)

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 19 of file qgsmaplayeractionregistry.cpp.

◆ QgsMapLayerAction() [2/3]

QgsMapLayerAction::QgsMapLayerAction ( const QString &  name,
QObject *  parent,
QgsMapLayer layer,
Targets  targets = AllActions,
const QIcon &  icon = QIcon() 
)

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

Definition at line 28 of file qgsmaplayeractionregistry.cpp.

◆ QgsMapLayerAction() [3/3]

QgsMapLayerAction::QgsMapLayerAction ( const QString &  name,
QObject *  parent,
QgsMapLayer::LayerType  layerType,
Targets  targets = AllActions,
const QIcon &  icon = QIcon() 
)

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

Definition at line 38 of file qgsmaplayeractionregistry.cpp.

◆ ~QgsMapLayerAction()

QgsMapLayerAction::~QgsMapLayerAction ( )

Definition at line 47 of file qgsmaplayeractionregistry.cpp.

Member Function Documentation

◆ canRunUsingLayer()

bool QgsMapLayerAction::canRunUsingLayer ( QgsMapLayer layer) const

True if action can run using the specified layer.

Definition at line 53 of file qgsmaplayeractionregistry.cpp.

◆ setTargets()

void QgsMapLayerAction::setTargets ( Targets  targets)
inline

Define the targets of the action.

Definition at line 73 of file qgsmaplayeractionregistry.h.

◆ targets()

const Targets& QgsMapLayerAction::targets ( ) const
inline

Return availibity of action.

Definition at line 75 of file qgsmaplayeractionregistry.h.

◆ triggeredForFeature

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

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()

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

Triggers the action with the specified layer and feature.

Definition at line 81 of file qgsmaplayeractionregistry.cpp.

◆ triggerForFeatures()

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

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

Definition at line 76 of file qgsmaplayeractionregistry.cpp.

◆ triggerForLayer()

void QgsMapLayerAction::triggerForLayer ( QgsMapLayer layer)

Triggers the action with the specified layer.

Definition at line 86 of file qgsmaplayeractionregistry.cpp.


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