QGIS API Documentation
3.43.0-Master (32433f7016e)
Toggle main menu visibility
Main Page
Related Pages
Topics
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
f
g
h
i
l
m
n
o
p
q
r
s
t
w
Functions
a
b
c
d
f
g
h
i
l
m
n
o
p
r
s
t
w
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
b
c
d
e
f
g
h
i
k
l
m
o
p
r
s
t
u
v
w
z
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 Symbols
3
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
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
e
f
g
h
i
l
n
o
p
q
r
s
t
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
Macros
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
w
y
Loading...
Searching...
No Matches
src
core
numericformats
qgsscientificnumericformat.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgsscientificnumericformat.cpp
3
----------------------------
4
begin : January 2020
5
copyright : (C) 2020 by Nyall Dawson
6
email : nyall dot dawson at gmail dot com
7
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 "
qgsscientificnumericformat.h
"
18
#include "
qgis.h
"
19
20
21
QgsScientificNumericFormat::QgsScientificNumericFormat
()
22
{
23
mUseScientific
=
true
;
24
}
21
QgsScientificNumericFormat::QgsScientificNumericFormat
() {
…
}
25
26
QString
QgsScientificNumericFormat::id
()
const
27
{
28
return
QStringLiteral(
"scientific"
);
29
}
26
QString
QgsScientificNumericFormat::id
()
const
{
…
}
30
31
QString
QgsScientificNumericFormat::visibleName
()
const
32
{
33
return
QObject::tr(
"Scientific"
);
34
}
31
QString
QgsScientificNumericFormat::visibleName
()
const
{
…
}
35
36
int
QgsScientificNumericFormat::sortKey
()
37
{
38
return
DEFAULT_SORT_KEY
;
39
}
36
int
QgsScientificNumericFormat::sortKey
() {
…
}
40
41
QString
QgsScientificNumericFormat::formatDouble
(
double
value,
const
QgsNumericFormatContext
&context )
const
42
{
43
return
QgsBasicNumericFormat::formatDouble
( value, context );
44
}
41
QString
QgsScientificNumericFormat::formatDouble
(
double
value,
const
QgsNumericFormatContext
&context )
const
{
…
}
45
46
QgsNumericFormat
*
QgsScientificNumericFormat::clone
()
const
47
{
48
return
new
QgsScientificNumericFormat
( *
this
);
49
}
46
QgsNumericFormat
*
QgsScientificNumericFormat::clone
()
const
{
…
}
50
51
QgsNumericFormat
*
QgsScientificNumericFormat::create
(
const
QVariantMap &configuration,
const
QgsReadWriteContext
&context )
const
52
{
53
auto
res = std::make_unique< QgsScientificNumericFormat >();
54
res->setConfiguration(
configuration
, context );
55
res->setRoundingType(
QgsBasicNumericFormat::DecimalPlaces
);
56
return
res.release();
57
}
51
QgsNumericFormat
*
QgsScientificNumericFormat::create
(
const
QVariantMap &configuration,
const
QgsReadWriteContext
&context )
const
{
…
}
58
59
QVariantMap
QgsScientificNumericFormat::configuration
(
const
QgsReadWriteContext
&context )
const
60
{
61
QVariantMap res =
QgsBasicNumericFormat::configuration
( context );
62
return
res;
63
}
59
QVariantMap
QgsScientificNumericFormat::configuration
(
const
QgsReadWriteContext
&context )
const
{
…
}
64
65
void
QgsScientificNumericFormat::setNumberDecimalPlaces
(
int
numberDecimalPlaces )
66
{
67
QgsBasicNumericFormat::setNumberDecimalPlaces
( std::max(
numberDecimalPlaces
, 1 ) );
68
}
65
void
QgsScientificNumericFormat::setNumberDecimalPlaces
(
int
numberDecimalPlaces ) {
…
}
QgsBasicNumericFormat::DecimalPlaces
@ DecimalPlaces
Maximum number of decimal places.
Definition
qgsbasicnumericformat.h:40
QgsBasicNumericFormat::mUseScientific
bool mUseScientific
Definition
qgsbasicnumericformat.h:168
QgsBasicNumericFormat::formatDouble
QString formatDouble(double value, const QgsNumericFormatContext &context) const override
Returns a formatted string representation of a numeric double value.
Definition
qgsbasicnumericformat.cpp:62
QgsBasicNumericFormat::setNumberDecimalPlaces
virtual void setNumberDecimalPlaces(int places)
Sets the maximum number of decimal places to show.
Definition
qgsbasicnumericformat.cpp:182
QgsBasicNumericFormat::numberDecimalPlaces
int numberDecimalPlaces() const
Returns the maximum number of decimal places to show.
Definition
qgsbasicnumericformat.cpp:177
QgsBasicNumericFormat::configuration
QVariantMap configuration(const QgsReadWriteContext &context) const override
Returns the current configuration of the formatter.
Definition
qgsbasicnumericformat.cpp:153
QgsNumericFormatContext
A context for numeric formats.
Definition
qgsnumericformat.h:36
QgsNumericFormat
Abstract base class for numeric formatters, which allow for formatting a numeric value for display.
Definition
qgsnumericformat.h:280
QgsNumericFormat::DEFAULT_SORT_KEY
static constexpr int DEFAULT_SORT_KEY
Definition
qgsnumericformat.h:373
QgsReadWriteContext
A container for the context for various read/write operations on objects.
Definition
qgsreadwritecontext.h:34
QgsScientificNumericFormat::setNumberDecimalPlaces
void setNumberDecimalPlaces(int places) override
Sets the maximum number of decimal places to show.
Definition
qgsscientificnumericformat.cpp:65
QgsScientificNumericFormat::sortKey
int sortKey() override
Returns a sorting key value, where formats with a lower sort key will be shown earlier in lists.
Definition
qgsscientificnumericformat.cpp:36
QgsScientificNumericFormat::id
QString id() const override
Returns a unique id for this numeric format.
Definition
qgsscientificnumericformat.cpp:26
QgsScientificNumericFormat::visibleName
QString visibleName() const override
Returns the translated, user-visible name for this format.
Definition
qgsscientificnumericformat.cpp:31
QgsScientificNumericFormat::create
QgsNumericFormat * create(const QVariantMap &configuration, const QgsReadWriteContext &context) const override
Creates a new copy of the format, using the supplied configuration.
Definition
qgsscientificnumericformat.cpp:51
QgsScientificNumericFormat::formatDouble
QString formatDouble(double value, const QgsNumericFormatContext &context) const override
Returns a formatted string representation of a numeric double value.
Definition
qgsscientificnumericformat.cpp:41
QgsScientificNumericFormat::clone
QgsNumericFormat * clone() const override
Clones the format, returning a new object.
Definition
qgsscientificnumericformat.cpp:46
QgsScientificNumericFormat::configuration
QVariantMap configuration(const QgsReadWriteContext &context) const override
Returns the current configuration of the formatter.
Definition
qgsscientificnumericformat.cpp:59
QgsScientificNumericFormat::QgsScientificNumericFormat
QgsScientificNumericFormat()
Default constructor.
Definition
qgsscientificnumericformat.cpp:21
qgis.h
qgsscientificnumericformat.h
Generated on Thu Apr 10 2025 10:57:09 for QGIS API Documentation by
1.9.8