QGIS API Documentation
2.18.21-Las Palmas (9fba24a)
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
a
b
c
d
e
f
g
i
l
m
n
o
p
s
t
+
Functions
a
b
c
d
f
g
i
l
m
n
o
p
t
Variables
Typedefs
Enumerations
Enumerator
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
2
_
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
_
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
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
+
Enumerations
a
b
c
d
e
f
g
h
i
j
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
h
i
l
m
n
o
p
r
s
t
u
v
+
Related Functions
a
c
d
e
f
g
l
n
o
p
q
r
s
t
v
+
Files
File List
+
File Members
+
All
_
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
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
u
z
+
Typedefs
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
Enumerations
Enumerator
+
Macros
a
b
c
d
e
f
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
src
core
qgsoptionalexpression.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgsoptionalexpression - QgsOptionalExpression
3
4
---------------------
5
begin : 14.9.2016
6
copyright : (C) 2016 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
17
#include "
qgsoptionalexpression.h
"
18
19
QgsOptionalExpression::QgsOptionalExpression
()
20
:
QgsOptional
<
QgsExpression
>()
21
{
22
23
}
24
25
QgsOptionalExpression::QgsOptionalExpression
(
const
QgsExpression
& expression )
26
:
QgsOptional
<
QgsExpression
>( expression )
27
{
28
29
}
30
31
QgsOptionalExpression::QgsOptionalExpression
(
const
QgsExpression
& expression,
bool
enabled
)
32
:
QgsOptional
<
QgsExpression
>( expression, enabled )
33
{
34
35
}
36
37
void
QgsOptionalExpression::writeXml
(
QDomElement
& element )
38
{
39
QDomText
exp = element.
ownerDocument
().
createTextNode
(
data
().expression() );
40
element.
setAttribute
(
"enabled"
,
enabled
() );
41
element.
appendChild
( exp );
42
}
43
44
void
QgsOptionalExpression::readXml
(
const
QDomElement
& element )
45
{
46
setEnabled
( element.
attribute
(
"enabled"
).
toInt
() );
47
setData
( element.
text
() );
48
}
QgsExpression
Class for parsing and evaluation of expressions (formerly called "search strings").
Definition:
qgsexpression.h:109
QgsOptionalExpression::QgsOptionalExpression
QgsOptionalExpression()
Construct a default optional expression.
Definition:
qgsoptionalexpression.cpp:19
QDomNode::appendChild
QDomNode appendChild(const QDomNode &newChild)
QgsOptional< QgsExpression >::enabled
bool enabled() const
Check if this optional is enabled.
Definition:
qgsoptional.h:87
QDomElement::attribute
QString attribute(const QString &name, const QString &defValue) const
QgsOptionalExpression::readXml
void readXml(const QDomElement &element)
Read the optional expression from the provided QDomElement.
Definition:
qgsoptionalexpression.cpp:44
QgsOptional< QgsExpression >::setData
void setData(const QgsExpression &data)
Set the payload data.
Definition:
qgsoptional.h:127
QDomNode::ownerDocument
QDomDocument ownerDocument() const
QDomElement::text
QString text() const
QDomElement::setAttribute
void setAttribute(const QString &name, const QString &value)
QString::toInt
int toInt(bool *ok, int base) const
QDomDocument::createTextNode
QDomText createTextNode(const QString &value)
QgsOptionalExpression::writeXml
void writeXml(QDomElement &element)
Save the optional expression to the provided QDomElement.
Definition:
qgsoptionalexpression.cpp:37
QgsOptional
QgsOptional is a container for other classes and adds an additional enabled/disabled flag...
Definition:
qgsoptional.h:32
QgsOptional< QgsExpression >::data
QgsExpression data() const
Access the payload data.
Definition:
qgsoptional.h:117
qgsoptionalexpression.h
QgsOptional< QgsExpression >::setEnabled
void setEnabled(bool enabled)
Set if this optional is enabled.
Definition:
qgsoptional.h:97
QDomElement
QDomText
Generated on Sun Jun 24 2018 11:42:48 for QGIS API Documentation by
1.8.13