Subgroup: Action
Class: QgsActionManager¶
-
class
qgis.core.
QgsActionManager
¶ Bases:
PyQt5.QtCore.QObject
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.
Methods
action
Get an action by its id. actions
Return a list of actions that are available in the given action scope. addAction
Add an action with the given name and action details. blockSignals
childEvent
children
clearActions
Removes all actions connectNotify
customEvent
defaultAction
Each scope can have a default action. deleteLater
disconnect
disconnectNotify
doAction
Does the action using the expression engine to replace any embedded expressions in the action definition. doActionFeature
Does the given action. dumpObjectInfo
dumpObjectTree
dynamicPropertyNames
event
eventFilter
findChild
findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject findChildren
findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] inherits
installEventFilter
isSignalConnected
isWidgetType
isWindowType
killTimer
layer
Return the layer metaObject
moveToThread
objectName
parent
property
pyqtConfigure
Each keyword argument is either the name of a Qt property or a Qt signal. readXml
Reads the actions in in XML format receivers
removeAction
Remove an action by its id. removeEventFilter
sender
senderSignalIndex
setDefaultAction
Each scope can have a default action. setObjectName
setParent
setProperty
signalsBlocked
startTimer
thread
timerEvent
tr
writeXml
Writes the actions out in XML format Attributes
destroyed
destroyed(self, QObject = None) [signal] objectNameChanged
objectNameChanged(self, str) [signal] staticMetaObject
-
action
(self, id: QUuid) → QgsAction¶ Get an action by its id.
New in version 3.0.
-
actions
(self, actionScope: str = '') → object¶ Return a list of actions that are available in the given action scope. If no action scope is provided, all actions will be returned.
New in version 3.0.
-
addAction
(self, type: QgsAction.ActionType, name: str, command: str, capture: bool = False) → QUuid¶ 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 doAction(), any stdout from the process will be captured and displayed in a dialog box.
addAction(self, type: QgsAction.ActionType, name: str, command: str, icon: str, capture: bool = False) -> QUuid 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 doAction(), any stdout from the process will be captured and displayed in a dialog box.
addAction(self, action: QgsAction) Add a new action to this list.
-
childEvent
()¶
-
clearActions
(self)¶ Removes all actions
-
connectNotify
()¶
-
customEvent
()¶
-
defaultAction
(self, actionScope: str) → QgsAction¶ Each scope can have a default action. This will be saved in the project file.
New in version 3.0.
-
disconnectNotify
()¶
-
doAction
(self, actionId: QUuid, feature: QgsFeature, context: QgsExpressionContext)¶ Does the action using the expression engine to replace any embedded expressions in the action definition.
Parameters: - actionId – action id
- feature – feature to run action for
- context – expression context to evaluate expressions under
-
doActionFeature
(self, actionId: QUuid, feature: QgsFeature, defaultValueIndex: int = 0, scope: QgsExpressionContextScope = QgsExpressionContextScope())¶ Does the given action.
Parameters: - actionId – action id
- feature – feature to run action for
- defaultValueIndex – index of the field to be used if the action has a $currfield placeholder.
- scope – expression context scope to add during expression evaluation
Note
available in Python bindings as doActionFeature
-
isSignalConnected
()¶
-
layer
(self) → QgsVectorLayer¶ Return the layer
-
readXml
(self, layer_node: QDomNode) → bool¶ Reads the actions in in XML format
-
receivers
()¶
-
removeAction
(self, actionId: QUuid)¶ Remove an action by its id.
New in version 3.0.
-
sender
()¶
-
senderSignalIndex
()¶
-
setDefaultAction
(self, actionScope: str, actionId: QUuid)¶ Each scope can have a default action. This will be saved in the project file.
New in version 3.0.
-
timerEvent
()¶
-
writeXml
(self, layer_node: QDomNode) → bool¶ Writes the actions out in XML format
-