QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
w
z
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
z
Variables
Typedefs
Enumerations
Enumerator
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
2
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
2
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
c
e
f
g
h
k
l
m
o
p
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Related Functions
3
a
c
d
e
f
g
i
l
m
n
o
p
q
r
s
t
v
Files
File List
File Members
All
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
Variables
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
w
Typedefs
3
a
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
Enumerator
c
l
s
t
Macros
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
w
y
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
src
core
qgsdefaultvalue.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgsdefaultvalue.cpp
3
4
---------------------
5
begin : 19.9.2017
6
copyright : (C) 2017 by Matthias Kuhn
7
email : matthias@opengis.ch
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 "
qgsdefaultvalue.h
"
17
18
QgsDefaultValue::QgsDefaultValue
(
const
QString &expression,
bool
applyOnUpdate )
19
: mExpression( expression )
20
, mApplyOnUpdate( applyOnUpdate )
21
{
22
23
}
24
25
bool
QgsDefaultValue::operator==
(
const
QgsDefaultValue
&other )
const
26
{
27
return
mExpression == other.mExpression
28
&& mApplyOnUpdate == other.mApplyOnUpdate;
29
}
30
31
QString
QgsDefaultValue::expression
()
const
32
{
33
return
mExpression;
34
}
35
36
void
QgsDefaultValue::setExpression
(
const
QString &expression )
37
{
38
mExpression =
expression
;
39
}
40
41
bool
QgsDefaultValue::applyOnUpdate
()
const
42
{
43
return
mApplyOnUpdate;
44
}
45
46
void
QgsDefaultValue::setApplyOnUpdate
(
bool
applyOnUpdate )
47
{
48
mApplyOnUpdate =
applyOnUpdate
;
49
}
50
51
bool
QgsDefaultValue::isValid
()
const
52
{
53
return
!mExpression.isEmpty();
54
}
55
56
QgsDefaultValue::operator bool()
const
57
{
58
return
!mExpression.isEmpty();
59
}
QgsDefaultValue
The QgsDefaultValue class provides a container for managing client side default values for fields.
Definition:
qgsdefaultvalue.h:49
qgsdefaultvalue.h
QgsDefaultValue::setExpression
void setExpression(const QString &expression)
The expression will be evaluated whenever a default value needs to be calculated for a field.
Definition:
qgsdefaultvalue.cpp:36
QgsDefaultValue::isValid
bool isValid() const
Returns if this default value should be applied.
Definition:
qgsdefaultvalue.cpp:51
QgsDefaultValue::setApplyOnUpdate
void setApplyOnUpdate(bool applyOnUpdate)
The applyOnUpdate flag determines if this expression should also be applied when a feature is updated...
Definition:
qgsdefaultvalue.cpp:46
QgsDefaultValue::expression
Q_GADGET QString expression
Definition:
qgsdefaultvalue.h:52
QgsDefaultValue::QgsDefaultValue
QgsDefaultValue(const QString &expression=QString(), bool applyOnUpdate=false)
Create a new default value with the given expression and applyOnUpdate flag.
Definition:
qgsdefaultvalue.cpp:18
QgsDefaultValue::applyOnUpdate
bool applyOnUpdate
Definition:
qgsdefaultvalue.h:53
QgsDefaultValue::operator==
bool operator==(const QgsDefaultValue &other) const
Definition:
qgsdefaultvalue.cpp:25
Generated on Sat Oct 24 2020 17:43:09 for QGIS API Documentation by
1.8.20