Subgroup: Action
Class: QgsAction¶
-
class
qgis.core.
QgsAction
¶ Bases:
sip.wrapper
Utility class that encapsulates an action based on vector attributes.
Methods
actionScopes
The action scopes define where an action will be available. capture
Whether to capture output for display when this action is run command
Returns the command that is executed by this action. expressionContextScope
Returns an expression context scope used for running the action. icon
The icon iconPath
The path to the icon id
Returns a unique id for this action. isValid
Returns true if this action was a default constructed one. name
The name of the action. notificationMessage
Returns the notification message that triggers the action readXml
Reads an XML definition from actionNode into this object. run
Run this action. runable
Checks if the action is runable on the current platform setActionScopes
The action scopes define where an action will be available. setExpressionContextScope
Sets an expression context scope to use for running the action. shortTitle
The short title is used to label user interface elements like buttons type
The action type writeXml
Appends an XML definition for this action as a new child node to actionsNode. Attributes
Generic
GenericPython
Mac
OpenUrl
Unix
Windows
-
class
ActionType
¶ Bases:
int
-
Generic
= 0¶
-
GenericPython
= 1¶
-
Mac
= 2¶
-
OpenUrl
= 5¶
-
Unix
= 4¶
-
Windows
= 3¶
-
actionScopes
(self) → Set[str]¶ The action scopes define where an action will be available. Action scopes may offer additional variables like the clicked coordinate.
See also
New in version 3.0.
-
capture
(self) → bool¶ Whether to capture output for display when this action is run
-
command
(self) → str¶ Returns the command that is executed by this action. How the content is interpreted depends on the type() and the actionScope().
New in version 3.0.
-
expressionContextScope
(self) → QgsExpressionContextScope¶ Returns an expression context scope used for running the action.
New in version 3.0.
-
icon
(self) → QIcon¶ The icon
-
iconPath
(self) → str¶ The path to the icon
-
id
(self) → QUuid¶ Returns a unique id for this action.
New in version 3.0.
-
isValid
(self) → bool¶ Returns true if this action was a default constructed one.
New in version 3.0.
-
name
(self) → str¶ The name of the action. This may be a longer description.
-
notificationMessage
(self) → str¶ Returns the notification message that triggers the action
New in version 3.0.
-
readXml
(self, actionNode: QDomNode)¶ Reads an XML definition from actionNode into this object.
New in version 3.0.
-
run
(self, layer: QgsVectorLayer, feature: QgsFeature, expressionContext: QgsExpressionContext)¶ Run this action.
New in version 3.0.
run(self, expressionContext: QgsExpressionContext) Run this action.
New in version 3.0.
-
runable
(self) → bool¶ Checks if the action is runable on the current platform
-
setActionScopes
(self, actionScopes: Iterable[str])¶ The action scopes define where an action will be available. Action scopes may offer additional variables like the clicked coordinate.
New in version 3.0.
-
setExpressionContextScope
(self, scope: QgsExpressionContextScope)¶ Sets an expression context scope to use for running the action.
New in version 3.0.
-
shortTitle
(self) → str¶ The short title is used to label user interface elements like buttons
-
type
(self) → QgsAction.ActionType¶ The action type
-
writeXml
(self, actionsNode: QDomNode)¶ Appends an XML definition for this action as a new child node to actionsNode.
New in version 3.0.
-
class