QGIS API Documentation 3.41.0-Master (af5edcb665c)
|
Utility class that encapsulates an action based on vector attributes. More...
#include <qgsaction.h>
Public Member Functions | |
QgsAction ()=default | |
QgsAction (const QUuid &id, Qgis::AttributeActionType type, const QString &description, const QString &action, const QString &icon, bool capture, const QString &shortTitle=QString(), const QSet< QString > &actionScopes=QSet< QString >(), const QString ¬ificationMessage=QString(), bool enabledOnlyWhenEditable=false) | |
Create a new QgsAction. | |
QgsAction (Qgis::AttributeActionType type, const QString &description, const QString &action, const QString &icon, bool capture, const QString &shortTitle=QString(), const QSet< QString > &actionScopes=QSet< QString >(), const QString ¬ificationMessage=QString(), bool enabledOnlyWhenEditable=false) | |
Create a new QgsAction. | |
QgsAction (Qgis::AttributeActionType type, const QString &description, const QString &command, bool capture=false, bool enabledOnlyWhenEditable=false) | |
Create a new QgsAction. | |
QSet< QString > | actionScopes () const |
The action scopes define where an action will be available. | |
bool | capture () const |
Whether to capture output for display when this action is run. | |
QString | command () const |
Returns the command that is executed by this action. | |
QgsExpressionContextScope | expressionContextScope () const |
Returns an expression context scope used for running the action. | |
QString | html () const |
Returns an HTML table with the basic information about this action. | |
QIcon | icon () const |
The icon. | |
QString | iconPath () const |
The path to the icon. | |
QUuid | id () const |
Returns a unique id for this action. | |
bool | isEnabledOnlyWhenEditable () const |
Returns whether only enabled in editable mode. | |
bool | isValid () const |
Returns true if this action was a default constructed one. | |
QString | name () const |
The name of the action. This may be a longer description. | |
QString | notificationMessage () const |
Returns the notification message that triggers the action. | |
void | readXml (const QDomNode &actionNode) |
Reads an XML definition from actionNode into this object. | |
void | run (const QgsExpressionContext &expressionContext) const |
Run this action. | |
void | run (QgsVectorLayer *layer, const QgsFeature &feature, const QgsExpressionContext &expressionContext) const |
Run this action. | |
bool | runable () const |
Checks if the action is runable on the current platform. | |
void | setActionScopes (const QSet< QString > &actionScopes) |
The action scopes define where an action will be available. | |
void | setCommand (const QString &newCommand) |
Sets the action command. | |
void | setEnabledOnlyWhenEditable (bool enable) |
Set whether the action is only enabled in editable mode. | |
void | setExpressionContextScope (const QgsExpressionContextScope &scope) |
Sets an expression context scope to use for running the action. | |
QString | shortTitle () const |
The short title is used to label user interface elements like buttons. | |
Qgis::AttributeActionType | type () const |
The action type. | |
void | writeXml (QDomNode &actionsNode) const |
Appends an XML definition for this action as a new child node to actionsNode. | |
Utility class that encapsulates an action based on vector attributes.
Definition at line 36 of file qgsaction.h.
|
default |
|
inline |
Create a new QgsAction.
type | The type of this action |
description | A human readable description string |
command | The action text. Its interpretation depends on the type |
capture | If this is set to true , the output will be captured when an action is run |
enabledOnlyWhenEditable | if true then action is only enable in editmode. Not available in Python bindings. |
Definition at line 51 of file qgsaction.h.
|
inline |
Create a new QgsAction.
type | The type of this action |
description | A human readable description string |
action | The action text. Its interpretation depends on the type |
icon | Path to an icon for this action |
capture | If this is set to true , the output will be captured when an action is run |
shortTitle | A short string used to label user interface elements like buttons |
actionScopes | A set of scopes in which this action will be available |
notificationMessage | A particular message which reception will trigger the action |
enabledOnlyWhenEditable | if true then action is only enable in editmode. Not available in Python bindings. |
Definition at line 73 of file qgsaction.h.
|
inline |
Create a new QgsAction.
id | The unique identifier of this action |
type | The type of this action |
description | A human readable description string |
action | The action text. Its interpretation depends on the type |
icon | Path to an icon for this action |
capture | If this is set to true , the output will be captured when an action is run |
shortTitle | A short string used to label user interface elements like buttons |
actionScopes | A set of scopes in which this action will be available |
notificationMessage | A particular message which reception will trigger the action |
enabledOnlyWhenEditable | if true then action is only enable in editmode. Not available in Python bindings. |
Definition at line 100 of file qgsaction.h.
QSet< QString > QgsAction::actionScopes | ( | ) | const |
The action scopes define where an action will be available.
Action scopes may offer additional variables like the clicked coordinate.
Definition at line 319 of file qgsaction.cpp.
|
inline |
Whether to capture output for display when this action is run.
Definition at line 156 of file qgsaction.h.
|
inline |
Returns the command that is executed by this action.
How the content is interpreted depends on the type() and the actionScope().
Definition at line 144 of file qgsaction.h.
QgsExpressionContextScope QgsAction::expressionContextScope | ( | ) | const |
Returns an expression context scope used for running the action.
Definition at line 392 of file qgsaction.cpp.
QString QgsAction::html | ( | ) | const |
Returns an HTML table with the basic information about this action.
Definition at line 397 of file qgsaction.cpp.
|
inline |
The icon.
Definition at line 136 of file qgsaction.h.
|
inline |
The path to the icon.
Definition at line 133 of file qgsaction.h.
|
inline |
Returns a unique id for this action.
Definition at line 124 of file qgsaction.h.
|
inline |
Returns whether only enabled in editable mode.
Definition at line 160 of file qgsaction.h.
|
inline |
Returns true
if this action was a default constructed one.
Definition at line 130 of file qgsaction.h.
|
inline |
The name of the action. This may be a longer description.
Definition at line 115 of file qgsaction.h.
|
inline |
Returns the notification message that triggers the action.
Definition at line 150 of file qgsaction.h.
void QgsAction::readXml | ( | const QDomNode & | actionNode | ) |
Reads an XML definition from actionNode into this object.
Definition at line 329 of file qgsaction.cpp.
void QgsAction::run | ( | const QgsExpressionContext & | expressionContext | ) | const |
Run this action.
Definition at line 275 of file qgsaction.cpp.
void QgsAction::run | ( | QgsVectorLayer * | layer, |
const QgsFeature & | feature, | ||
const QgsExpressionContext & | expressionContext | ||
) | const |
Run this action.
Definition at line 78 of file qgsaction.cpp.
bool QgsAction::runable | ( | ) | const |
Checks if the action is runable on the current platform.
Definition at line 41 of file qgsaction.cpp.
void QgsAction::setActionScopes | ( | const QSet< QString > & | actionScopes | ) |
The action scopes define where an action will be available.
Action scopes may offer additional variables like the clicked coordinate.
Definition at line 324 of file qgsaction.cpp.
void QgsAction::setCommand | ( | const QString & | newCommand | ) |
|
inline |
Set whether the action is only enabled in editable mode.
Definition at line 167 of file qgsaction.h.
void QgsAction::setExpressionContextScope | ( | const QgsExpressionContextScope & | scope | ) |
Sets an expression context scope to use for running the action.
Definition at line 387 of file qgsaction.cpp.
|
inline |
The short title is used to label user interface elements like buttons.
Definition at line 118 of file qgsaction.h.
|
inline |
The action type.
Definition at line 153 of file qgsaction.h.
void QgsAction::writeXml | ( | QDomNode & | actionsNode | ) | const |
Appends an XML definition for this action as a new child node to actionsNode.
Definition at line 363 of file qgsaction.cpp.