QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
QgsActionScope Class Reference

An action scope defines a "place" for an action to be shown and may add additional expression variables. More...

#include <qgsactionscope.h>

Public Member Functions

 QgsActionScope ()
 Creates a new invalid action scope.
 
 QgsActionScope (const QString &id, const QString &title, const QString &description, const QgsExpressionContextScope &expressionContextScope=QgsExpressionContextScope())
 Creates a new action scope.
 
QString description () const
 Returns the action scope's description.
 
QgsExpressionContextScope expressionContextScope () const
 Returns the expression context scope for the action scope.
 
QString id () const
 Returns the unique identifier for this action scope.
 
bool isValid () const
 Returns true if this scope is valid.
 
bool operator== (const QgsActionScope &other) const
 
void setDescription (const QString &description)
 Sets the action scope's description.
 
void setExpressionContextScope (const QgsExpressionContextScope &expressionContextScope)
 Sets the expression context scope for the action scope.
 
void setId (const QString &id)
 Sets the unique id for this action scope.
 
void setTitle (const QString &title)
 Sets the action scope's title.
 
QString title () const
 Returns the action scope's title.
 

Detailed Description

An action scope defines a "place" for an action to be shown and may add additional expression variables.

Each QgsAction can be available in one or several action scopes.

Examples

Canvas

Show for canvas tools. Adds @click_x and @click_y in map coordinates.

Feature

Show in feature specific places like the attribute table or feature form.

Field

Show in context menus for individual fields (e.g. attribute table). Adds @field_index, @field_name and @field_value.

Layer

Show in attribute table and work on the layer or selection.

Definition at line 48 of file qgsactionscope.h.

Constructor & Destructor Documentation

◆ QgsActionScope() [1/2]

QgsActionScope::QgsActionScope ( )
explicit

Creates a new invalid action scope.

Definition at line 19 of file qgsactionscope.cpp.

◆ QgsActionScope() [2/2]

QgsActionScope::QgsActionScope ( const QString &  id,
const QString &  title,
const QString &  description,
const QgsExpressionContextScope expressionContextScope = QgsExpressionContextScope() 
)
explicit

Creates a new action scope.

For details concerning the parameters check the documentation of the corresponding properties.

Definition at line 24 of file qgsactionscope.cpp.

Member Function Documentation

◆ description()

QString QgsActionScope::description ( ) const

Returns the action scope's description.

The description should be a longer description of where actions in this scope are available. It is not necessary to list the available expression variables in here, they are extracted automatically from the expressionContextScope().

See also
setDescription()

Definition at line 72 of file qgsactionscope.cpp.

◆ expressionContextScope()

QgsExpressionContextScope QgsActionScope::expressionContextScope ( ) const

Returns the expression context scope for the action scope.

An expression scope may offer additional variables for an action scope. This can be an field_name for the attribute which was clicked or click_x and click_y for actions which are available as map canvas clicks.

See also
setExpressionContextScope()

Definition at line 37 of file qgsactionscope.cpp.

◆ id()

QString QgsActionScope::id ( ) const

Returns the unique identifier for this action scope.

See also
setId()

Definition at line 47 of file qgsactionscope.cpp.

◆ isValid()

bool QgsActionScope::isValid ( ) const

Returns true if this scope is valid.

Definition at line 57 of file qgsactionscope.cpp.

◆ operator==()

bool QgsActionScope::operator== ( const QgsActionScope other) const

Definition at line 32 of file qgsactionscope.cpp.

◆ setDescription()

void QgsActionScope::setDescription ( const QString &  description)

Sets the action scope's description.

The description should be a longer description of where actions in this scope are available. It is not necessary to list the available expression variables in here, they are extracted automatically from the expressionContextScope().

See also
description()

Definition at line 77 of file qgsactionscope.cpp.

◆ setExpressionContextScope()

void QgsActionScope::setExpressionContextScope ( const QgsExpressionContextScope expressionContextScope)

Sets the expression context scope for the action scope.

An expression scope may offer additional variables for an action scope. This can be an field_name for the attribute which was clicked or click_x and click_y for actions which are available as map canvas clicks.

See also
expressionContextScope()

Definition at line 42 of file qgsactionscope.cpp.

◆ setId()

void QgsActionScope::setId ( const QString &  id)

Sets the unique id for this action scope.

See also
id()

Definition at line 52 of file qgsactionscope.cpp.

◆ setTitle()

void QgsActionScope::setTitle ( const QString &  title)

Sets the action scope's title.

The title should be a human readable and translated string that will be presented to the user in the properties dialog.

See also
title()

Definition at line 67 of file qgsactionscope.cpp.

◆ title()

QString QgsActionScope::title ( ) const

Returns the action scope's title.

The title is a human readable and translated string that will be presented to the user in the properties dialog.

See also
setTitle()

Definition at line 62 of file qgsactionscope.cpp.


The documentation for this class was generated from the following files: