16 #ifndef QGSMAPLAYERACTIONREGISTRY_H
17 #define QGSMAPLAYERACTIONREGISTRY_H
48 AllActions = Layer | SingleFeature | MultipleFeatures
50 Q_DECLARE_FLAGS( Targets, Target )
59 EnabledOnlyWhenEditable = 1 << 1,
66 Q_DECLARE_FLAGS( Flags, Flag )
73 QgsMapLayerAction(
const QString &name, QObject *parent
SIP_TRANSFERTHIS, Targets targets = AllActions,
const QIcon &icon = QIcon(), QgsMapLayerAction::Flags flags = QgsMapLayerAction::Flags() );
87 QgsMapLayerAction::Flags flags()
const;
90 virtual bool canRunUsingLayer(
QgsMapLayer *layer )
const;
93 virtual void triggerForFeatures(
QgsMapLayer *layer,
const QList<QgsFeature> &featureList );
104 const Targets &
targets()
const {
return mTargets;}
110 bool isEnabledOnlyWhenEditable()
const;
125 bool mSingleLayer =
false;
130 bool mSpecificLayerType =
false;
135 Targets mTargets = Targets();
137 QgsMapLayerAction::Flags mFlags = QgsMapLayerAction::Flags();
187 QMap< QgsMapLayer *, QgsMapLayerAction * > mDefaultLayerActionMap;
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
This class tracks map layer actions.
void changed()
Triggered when an action is added or removed from the registry.
QList< QgsMapLayerAction * > mMapLayerActionList
An action which can run on map layers The class can be used in two manners:
void triggeredForFeatures(QgsMapLayer *layer, const QList< QgsFeature > &featureList)
Triggered when action has been run for a specific list of features.
const Targets & targets() const
Returns availibity of action.
Flag
Flags which control action behavior /since QGIS 3.0.
void setTargets(Targets targets)
Define the targets of the action.
void triggeredForLayer(QgsMapLayer *layer)
Triggered when action has been run for a specific layer.
void triggeredForFeature(QgsMapLayer *layer, const QgsFeature &feature)
Triggered when action has been run for a specific feature.
Base class for all map layer types.
QgsMapLayerType
Types of layers that can be added to a map.
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsField::ConfigurationFlags) CORE_EXPORT QDataStream &operator<<(QDataStream &out
Writes the field to stream out. QGIS version compatibility is not guaranteed.