1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsmaplayeractionregistry.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsMapLayerAction : QAction
{
%Docstring(signature="appended")
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
#include "qgsmaplayeractionregistry.h"
%End
public:
enum Target
{
Layer,
SingleFeature,
MultipleFeatures,
AllActions
};
typedef QFlags<QgsMapLayerAction::Target> Targets;
enum Flag
{
EnabledOnlyWhenEditable,
};
typedef QFlags<QgsMapLayerAction::Flag> Flags;
QgsMapLayerAction( const QString &name, QObject *parent /TransferThis/, Targets targets = AllActions, const QIcon &icon = QIcon(), QgsMapLayerAction::Flags flags = QgsMapLayerAction::Flags() );
%Docstring
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.
%End
QgsMapLayerAction( const QString &name, QObject *parent /TransferThis/, QgsMapLayer *layer, Targets targets = AllActions, const QIcon &icon = QIcon(), QgsMapLayerAction::Flags flags = QgsMapLayerAction::Flags() );
%Docstring
Creates a map layer action which can run only on a specific layer
%End
QgsMapLayerAction( const QString &name, QObject *parent /TransferThis/, QgsMapLayerType layerType, Targets targets = AllActions, const QIcon &icon = QIcon(), QgsMapLayerAction::Flags flags = QgsMapLayerAction::Flags() );
%Docstring
Creates a map layer action which can run on a specific type of layer
%End
~QgsMapLayerAction();
QgsMapLayerAction::Flags flags() const;
%Docstring
Layer behavior flags.
.. versionadded:: 3.0
%End
virtual bool canRunUsingLayer( QgsMapLayer *layer ) const;
%Docstring
True if action can run using the specified layer
%End
virtual void triggerForFeatures( QgsMapLayer *layer, const QList<QgsFeature> &featureList );
%Docstring
Triggers the action with the specified layer and list of feature.
%End
virtual void triggerForFeature( QgsMapLayer *layer, const QgsFeature &feature );
%Docstring
Triggers the action with the specified layer and feature.
%End
virtual void triggerForLayer( QgsMapLayer *layer );
%Docstring
Triggers the action with the specified layer.
%End
void setTargets( Targets targets );
%Docstring
Define the targets of the action
%End
const Targets &targets() const;
%Docstring
Returns availibity of action
%End
bool isEnabledOnlyWhenEditable() const;
%Docstring
Returns ``True`` if the action is only enabled for layers in editable mode.
.. versionadded:: 3.0
%End
signals:
void triggeredForFeatures( QgsMapLayer *layer, const QList<QgsFeature> &featureList );
%Docstring
Triggered when action has been run for a specific list of features
%End
void triggeredForFeature( QgsMapLayer *layer, const QgsFeature &feature );
%Docstring
Triggered when action has been run for a specific feature
%End
void triggeredForLayer( QgsMapLayer *layer );
%Docstring
Triggered when action has been run for a specific layer
%End
};
QFlags<QgsMapLayerAction::Target> operator|(QgsMapLayerAction::Target f1, QFlags<QgsMapLayerAction::Target> f2);
class QgsMapLayerActionRegistry : QObject
{
%Docstring(signature="appended")
This class tracks map layer actions.
:py:class:`QgsMapLayerActionRegistry` is not usually directly created, but rather accessed through
:py:func:`QgsGui.mapLayerActionRegistry()`.
%End
%TypeHeaderCode
#include "qgsmaplayeractionregistry.h"
%End
public:
QgsMapLayerActionRegistry( QObject *parent = 0 );
%Docstring
Constructor for QgsMapLayerActionRegistry.
QgsMapLayerActionRegistry is not usually directly created, but rather accessed through
:py:func:`QgsGui.mapLayerActionRegistry()`.
%End
void addMapLayerAction( QgsMapLayerAction *action );
%Docstring
Adds a map layer action to the registry
%End
QList<QgsMapLayerAction *> mapLayerActions( QgsMapLayer *layer, QgsMapLayerAction::Targets targets = QgsMapLayerAction::AllActions );
%Docstring
Returns the map layer actions which can run on the specified layer
%End
bool removeMapLayerAction( QgsMapLayerAction *action );
%Docstring
Removes a map layer action from the registry
%End
void setDefaultActionForLayer( QgsMapLayer *layer, QgsMapLayerAction *action );
%Docstring
Sets the default action for a layer
%End
QgsMapLayerAction *defaultActionForLayer( QgsMapLayer *layer );
%Docstring
Returns the default action for a layer
%End
protected:
signals:
void changed();
%Docstring
Triggered when an action is added or removed from the registry
%End
};
QFlags<QgsMapLayerAction::Flag> operator|(QgsMapLayerAction::Flag f1, QFlags<QgsMapLayerAction::Flag> f2);
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsmaplayeractionregistry.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
|