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
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/actions/qgsactionmanager.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsActionManager: QObject
{
%Docstring(signature="appended")
Storage and management of actions associated with a layer.
Actions can trigger custom code or applications to be executed based on
attributes of a given feature.
%End
%TypeHeaderCode
#include "qgsactionmanager.h"
%End
public:
QgsActionManager( QgsVectorLayer *layer );
%Docstring
Constructor
%End
QUuid addAction( Qgis::AttributeActionType type, const QString &name, const QString &command, bool capture = false );
%Docstring
Add an action with the given name and action details. Will happily have
duplicate names and actions. If capture is ``True``, when running the
action using :py:func:`~QgsActionManager.doAction`, any stdout from the
process will be captured and displayed in a dialog box.
%End
QUuid addAction( Qgis::AttributeActionType type, const QString &name, const QString &command, const QString &icon, bool capture = false );
%Docstring
Add an action with the given name and action details. Will happily have
duplicate names and actions. If capture is ``True``, when running the
action using :py:func:`~QgsActionManager.doAction`, any stdout from the
process will be captured and displayed in a dialog box.
%End
void addAction( const QgsAction &action );
%Docstring
Add a new action to this list.
%End
void removeAction( QUuid actionId );
%Docstring
Remove an action by its id.
%End
void doAction( QUuid actionId, const QgsFeature &feature, int defaultValueIndex = 0, const QgsExpressionContextScope &scope = QgsExpressionContextScope() ) /PyName=doActionFeature/;
%Docstring
Does the given action.
:param actionId: action id
:param feature: feature to run action for
:param defaultValueIndex: index of the field to be used if the action
has a $currfield placeholder.
:param scope: expression context scope to add during expression
evaluation
%End
void doAction( QUuid actionId, const QgsFeature &feature, const QgsExpressionContext &context );
%Docstring
Does the action using the expression engine to replace any embedded
expressions in the action definition.
:param actionId: action id
:param feature: feature to run action for
:param context: expression context to evaluate expressions under
%End
void clearActions();
%Docstring
Removes all actions
%End
QList<QgsAction> actions( const QString &actionScope = QString() ) const;
%Docstring
Returns a list of actions that are available in the given action scope.
If no action scope is provided, all actions will be returned.
%End
QgsVectorLayer *layer() const;
%Docstring
Returns the layer
%End
bool writeXml( QDomNode &layer_node ) const;
%Docstring
Writes the actions out in XML format
%End
bool readXml( const QDomNode &layer_node );
%Docstring
Reads the actions in in XML format
%End
QgsAction action( QUuid id ) const;
%Docstring
Gets an action by its ``id``.
%End
QgsAction action( const QString &id ) const;
%Docstring
Gets an action by its ``id``.
.. versionadded:: 3.28
%End
void setDefaultAction( const QString &actionScope, QUuid actionId );
%Docstring
Each scope can have a default action. This will be saved in the project
file.
%End
QgsAction defaultAction( const QString &actionScope );
%Docstring
Each scope can have a default action. This will be saved in the project
file.
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/actions/qgsactionmanager.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|