| 
    QGIS API Documentation
    3.26.3-Buenos Aires (65e4edfdad)
    
   | 
 
An action which can run on map layers The class can be used in two manners: More...
#include <qgsmaplayeractionregistry.h>

Public Types | |
| enum | Flag { EnabledOnlyWhenEditable = 1 << 1 } | 
| Flags which control action behavior /since QGIS 3.0.  More... | |
| 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, 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:
Definition at line 38 of file qgsmaplayeractionregistry.h.
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.
| Enumerator | |
|---|---|
| Layer | |
| SingleFeature | |
| MultipleFeatures | |
| AllActions | |
Definition at line 43 of file qgsmaplayeractionregistry.h.
| QgsMapLayerAction::QgsMapLayerAction | ( | const QString & | name, | 
| QObject * | parent, | ||
| Targets | targets = AllActions,  | 
        ||
| const QIcon & | icon = QIcon(),  | 
        ||
| QgsMapLayerAction::Flags | flags = QgsMapLayerAction::Flags()  | 
        ||
| ) | 
Action behavior flags.
Definition at line 20 of file qgsmaplayeractionregistry.cpp.
| QgsMapLayerAction::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.
Definition at line 27 of file qgsmaplayeractionregistry.cpp.
| QgsMapLayerAction::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.
Definition at line 36 of file qgsmaplayeractionregistry.cpp.
      
  | 
  override | 
Definition at line 45 of file qgsmaplayeractionregistry.cpp.
      
  | 
  virtual | 
True if action can run using the specified layer.
Definition at line 56 of file qgsmaplayeractionregistry.cpp.
| QgsMapLayerAction::Flags QgsMapLayerAction::flags | ( | ) | const | 
| bool QgsMapLayerAction::isEnabledOnlyWhenEditable | ( | ) | const | 
Returns true if the action is only enabled for layers in editable mode. 
Definition at line 105 of file qgsmaplayeractionregistry.cpp.
      
  | 
  inline | 
Define the targets of the action.
Definition at line 102 of file qgsmaplayeractionregistry.h.
      
  | 
  inline | 
Returns availibity of action.
Definition at line 104 of file qgsmaplayeractionregistry.h.
      
  | 
  signal | 
Triggered when action has been run for a specific feature.
      
  | 
  signal | 
Triggered when action has been run for a specific list of features.
      
  | 
  signal | 
Triggered when action has been run for a specific layer.
      
  | 
  virtual | 
Triggers the action with the specified layer and feature.
Definition at line 95 of file qgsmaplayeractionregistry.cpp.
      
  | 
  virtual | 
Triggers the action with the specified layer and list of feature.
Definition at line 90 of file qgsmaplayeractionregistry.cpp.
      
  | 
  virtual | 
Triggers the action with the specified layer.
Definition at line 100 of file qgsmaplayeractionregistry.cpp.
 1.8.17