24 #ifndef QGSATTRIBUTEACTION_H 25 #define QGSATTRIBUTEACTION_H 55 mType( type ), mName( name ), mAction( action ), mCaptureOutput( capture ) {}
58 mType( type ), mName( name ), mIcon( icon ), mAction( action ), mCaptureOutput( capture ) {}
76 bool capture()
const {
return mCaptureOutput; }
81 return mType == Generic ||
82 mType == GenericPython ||
86 #elif defined(Q_OS_MAC) 133 void removeAction(
int index );
139 void doAction(
int index,
141 int defaultValueIndex = 0 );
149 void doAction(
int index,
184 bool readXML(
const QDomNode& layer_node );
186 int size()
const {
return mActions.size(); }
193 Q_DECL_DEPRECATED
static void setPythonExecute(
void ( * )(
const QString & ) );
196 int defaultAction()
const {
return mDefaultAction < 0 || mDefaultAction >= size() ? -1 : mDefaultAction; }
202 static void ( *smPythonExecute )(
const QString & );
205 void ( *executePython )(
const QString & ) =
nullptr );
const QString iconPath() const
The path to the icon.
QgsAction & operator[](int idx)
Storage and management of actions associated with Qgis layer attributes.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
QgsAction(ActionType type, const QString &name, const QString &action, bool capture)
bool capture() const
Whether to capture output for display when this action is run.
QString name() const
The name of the action.
const QIcon icon() const
The icon.
Utility class that encapsulates an action based on vector attributes.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
QString action() const
The action.
QgsAction(ActionType type, const QString &name, const QString &action, const QString &icon, bool capture)
ActionType type() const
The action type.
virtual ~QgsAttributeAction()
Destructor.
const QList< QgsAction > & listActions()
List all actions.
QgsVectorLayer * layer()
Return the layer.
bool runable() const
Whether the action is runable on the current platform.
QgsAttributeAction(QgsVectorLayer *layer)
Constructor.
Represents a vector layer which manages a vector based data sets.
void setDefaultAction(int actionNumber)
void clearActions()
Removes all actions.
int defaultAction() const
Whether the action is the default action.