QGIS API Documentation
3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
src
core
actions
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
7
email :
[email protected]
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
18
#include "
qgsexpressioncontext.h
"
19
20
QgsActionScope::QgsActionScope
()
21
: mExpressionContextScope( nullptr )
22
{
23
}
24
25
QgsActionScope::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
33
bool
QgsActionScope::operator==
(
const
QgsActionScope
&other )
const
34
{
35
return
other.mId == mId;
36
}
37
38
QgsExpressionContextScope
QgsActionScope::expressionContextScope
()
const
39
{
40
return
mExpressionContextScope;
41
}
42
43
void
QgsActionScope::setExpressionContextScope
(
const
QgsExpressionContextScope
&
expressionContextScope
)
44
{
45
mExpressionContextScope =
expressionContextScope
;
46
}
47
48
QString
QgsActionScope::id
()
const
49
{
50
return
mId;
51
}
52
53
void
QgsActionScope::setId
(
const
QString &name )
54
{
55
mId = name;
56
}
57
58
bool
QgsActionScope::isValid
()
const
59
{
60
return
!mId.isNull();
61
}
62
63
QString
QgsActionScope::title
()
const
64
{
65
return
mTitle;
66
}
67
68
void
QgsActionScope::setTitle
(
const
QString &
title
)
69
{
70
mTitle =
title
;
71
}
72
73
QString
QgsActionScope::description
()
const
74
{
75
return
mDescription;
76
}
77
78
void
QgsActionScope::setDescription
(
const
QString &
description
)
79
{
80
mDescription =
description
;
81
}
82
83
uint
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
}
QgsActionScope
An action scope defines a "place" for an action to be shown and may add additional expression variabl...
Definition
qgsactionscope.h:50
QgsActionScope::QgsActionScope
QgsActionScope()
Creates a new invalid action scope.
Definition
qgsactionscope.cpp:20
QgsActionScope::setTitle
void setTitle(const QString &title)
Sets the action scope's title.
Definition
qgsactionscope.cpp:68
QgsActionScope::description
QString description() const
Returns the action scope's description.
Definition
qgsactionscope.cpp:73
QgsActionScope::setDescription
void setDescription(const QString &description)
Sets the action scope's description.
Definition
qgsactionscope.cpp:78
QgsActionScope::expressionContextScope
QgsExpressionContextScope expressionContextScope() const
Returns the expression context scope for the action scope.
Definition
qgsactionscope.cpp:38
QgsActionScope::id
QString id() const
Returns the unique identifier for this action scope.
Definition
qgsactionscope.cpp:48
QgsActionScope::setId
void setId(const QString &id)
Sets the unique id for this action scope.
Definition
qgsactionscope.cpp:53
QgsActionScope::title
QString title() const
Returns the action scope's title.
Definition
qgsactionscope.cpp:63
QgsActionScope::isValid
bool isValid() const
Returns true if this scope is valid.
Definition
qgsactionscope.cpp:58
QgsActionScope::operator==
bool operator==(const QgsActionScope &other) const
Definition
qgsactionscope.cpp:33
QgsActionScope::setExpressionContextScope
void setExpressionContextScope(const QgsExpressionContextScope &expressionContextScope)
Sets the expression context scope for the action scope.
Definition
qgsactionscope.cpp:43
QgsExpressionContextScope
Single scope for storing variables and functions for use within a QgsExpressionContext.
Definition
qgsexpressioncontext.h:116
QgsExpressionContextScope::variableNames
QStringList variableNames() const
Returns a list of variable names contained within the scope.
Definition
qgsexpressioncontext.cpp:163
qHash
uint qHash(const QgsActionScope &key, uint seed)
Definition
qgsactionscope.cpp:83
qgsactionscope.h
qgsexpressioncontext.h
Generated on
for QGIS API Documentation by
1.15.0