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
fieldformatter
qgslistfieldformatter.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgslistfieldformatter.cpp - QgsListFieldFormatter
3
4
---------------------
5
begin : 3.12.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
#include "
qgslistfieldformatter.h
"
17
#include "
qgsapplication.h
"
18
#include <QSettings>
19
20
QString
QgsListFieldFormatter::id
()
const
21
{
22
return
QStringLiteral(
"List"
);
23
}
24
25
QString
QgsListFieldFormatter::representValue
(
QgsVectorLayer
*layer,
int
fieldIndex,
const
QVariantMap &config,
const
QVariant &cache,
const
QVariant &value )
const
26
{
27
Q_UNUSED( layer )
28
Q_UNUSED( fieldIndex )
29
Q_UNUSED( config )
30
Q_UNUSED( cache )
31
32
if
( value.isNull() )
33
{
34
return
QgsApplication::nullRepresentation
();
35
}
36
37
QString result;
38
const
QVariantList list = value.toList();
39
for
(
const
QVariant &val : list )
40
{
41
if
( !result.isEmpty() )
42
result.append(
", "
);
43
result.append( val.toString() );
44
}
45
return
result;
46
}
QgsListFieldFormatter::id
QString id() const override
Returns a unique id for this field formatter.
Definition:
qgslistfieldformatter.cpp:20
qgsapplication.h
QgsListFieldFormatter::representValue
QString representValue(QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config, const QVariant &cache, const QVariant &value) const override
Create a pretty String representation of the value.
Definition:
qgslistfieldformatter.cpp:25
QgsApplication::nullRepresentation
static QString nullRepresentation()
This string is used to represent the value NULL throughout QGIS.
Definition:
qgsapplication.cpp:1851
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition:
qgsvectorlayer.h:387
qgslistfieldformatter.h
Generated on Sat Oct 24 2020 17:43:09 for QGIS API Documentation by
1.8.20