QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
qgsactionscope.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsactionscope.cpp - QgsActionScope
3
4 ---------------------
5 begin : 1.11.2016
6 copyright : (C) 2016 by Matthias Kuhn
8 ***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16#include "qgsactionscope.h"
17
19
21 : mExpressionContextScope( nullptr )
22{
23}
24
25QgsActionScope::QgsActionScope( const QString &id, const QString &title, const QString &description, const QgsExpressionContextScope &expressionContextScope )
26 : mId( id )
27 , mTitle( title )
28 , mDescription( description )
29 , mExpressionContextScope( expressionContextScope )
30{
31}
32
34{
35 return other.mId == mId;
36}
37
39{
40 return mExpressionContextScope;
41}
42
47
48QString QgsActionScope::id() const
49{
50 return mId;
51}
52
53void QgsActionScope::setId( const QString &name )
54{
55 mId = name;
56}
57
59{
60 return !mId.isNull();
61}
62
63QString QgsActionScope::title() const
64{
65 return mTitle;
66}
67
68void QgsActionScope::setTitle( const QString &title )
69{
70 mTitle = title;
71}
72
74{
75 return mDescription;
76}
77
79{
80 mDescription = description;
81}
82
83uint qHash( const QgsActionScope &key, uint seed )
84{
85 uint hash = seed;
86
87 hash |= qHash( key.expressionContextScope().variableNames().join( ',' ), seed );
88 hash |= qHash( key.id(), seed );
89
90 return hash;
91}
An action scope defines a "place" for an action to be shown and may add additional expression variabl...
QgsActionScope()
Creates a new invalid action scope.
void setTitle(const QString &title)
Sets the action scope's title.
QString description() const
Returns the action scope's description.
void setDescription(const QString &description)
Sets 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.
void setId(const QString &id)
Sets the unique id for this action scope.
QString title() const
Returns the action scope's title.
bool isValid() const
Returns true if this scope is valid.
bool operator==(const QgsActionScope &other) const
void setExpressionContextScope(const QgsExpressionContextScope &expressionContextScope)
Sets the expression context scope for the action scope.
Single scope for storing variables and functions for use within a QgsExpressionContext.
QStringList variableNames() const
Returns a list of variable names contained within the scope.
uint qHash(const QgsActionScope &key, uint seed)