Skip to content
Permalink
Browse files

make methods of QgsMapLayerAction virtual so the canRunUsingLayer can…

… be fine tuned (#42613)
  • Loading branch information
3nids authored and nyalldawson committed Apr 6, 2021
1 parent 3fea7b6 commit 523510c60510245419b250fdf2cb5a88dad8b6f8
Showing with 14 additions and 8 deletions.
  1. +7 −4 python/gui/auto_generated/qgsmaplayeractionregistry.sip.in
  2. +7 −4 src/gui/qgsmaplayeractionregistry.h
@@ -14,6 +14,9 @@ class QgsMapLayerAction : QAction
{
%Docstring
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)
%End

%TypeHeaderCode
@@ -66,22 +69,22 @@ Layer behavior flags.
.. versionadded:: 3.0
%End

bool canRunUsingLayer( QgsMapLayer *layer ) const;
virtual bool canRunUsingLayer( QgsMapLayer *layer ) const;
%Docstring
True if action can run using the specified layer
%End

void triggerForFeatures( QgsMapLayer *layer, const QList<QgsFeature> &featureList );
virtual void triggerForFeatures( QgsMapLayer *layer, const QList<QgsFeature> &featureList );
%Docstring
Triggers the action with the specified layer and list of feature.
%End

void triggerForFeature( QgsMapLayer *layer, const QgsFeature &feature );
virtual void triggerForFeature( QgsMapLayer *layer, const QgsFeature &feature );
%Docstring
Triggers the action with the specified layer and feature.
%End

void triggerForLayer( QgsMapLayer *layer );
virtual void triggerForLayer( QgsMapLayer *layer );
%Docstring
Triggers the action with the specified layer.
%End
@@ -30,6 +30,9 @@ class QgsFeature;
/**
* \ingroup gui
* \brief 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)
*/
class GUI_EXPORT QgsMapLayerAction : public QAction
{
@@ -83,16 +86,16 @@ class GUI_EXPORT QgsMapLayerAction : public QAction
QgsMapLayerAction::Flags flags() const;

//! True if action can run using the specified layer
bool canRunUsingLayer( QgsMapLayer *layer ) const;
virtual bool canRunUsingLayer( QgsMapLayer *layer ) const;

//! Triggers the action with the specified layer and list of feature.
void triggerForFeatures( QgsMapLayer *layer, const QList<QgsFeature> &featureList );
virtual void triggerForFeatures( QgsMapLayer *layer, const QList<QgsFeature> &featureList );

//! Triggers the action with the specified layer and feature.
void triggerForFeature( QgsMapLayer *layer, const QgsFeature &feature );
virtual void triggerForFeature( QgsMapLayer *layer, const QgsFeature &feature );

//! Triggers the action with the specified layer.
void triggerForLayer( QgsMapLayer *layer );
virtual void triggerForLayer( QgsMapLayer *layer );

//! Define the targets of the action
void setTargets( Targets targets ) {mTargets = targets;}

0 comments on commit 523510c

Please sign in to comment.