QGIS API Documentation
3.99.0-Master (d270888f95f)
Loading...
Searching...
No Matches
src
core
numericformats
qgsfallbacknumericformat.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgsfallbacknumericformat.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 "
qgsfallbacknumericformat.h
"
18
19
#include <QString>
20
21
using namespace
Qt::StringLiterals;
22
23
QString
QgsFallbackNumericFormat::id
()
const
24
{
25
return
u
"default"
_s;
26
}
27
28
QString
QgsFallbackNumericFormat::visibleName
()
const
29
{
30
return
QObject::tr(
"General"
);
31
}
32
33
int
QgsFallbackNumericFormat::sortKey
()
34
{
35
return
0;
36
}
37
38
QString
QgsFallbackNumericFormat::formatDouble
(
double
value,
const
QgsNumericFormatContext
& )
const
39
{
40
return
QString::number( value );
41
}
42
43
QgsNumericFormat
*
QgsFallbackNumericFormat::clone
()
const
44
{
45
return
new
QgsFallbackNumericFormat
();
46
}
47
48
QgsNumericFormat
*
QgsFallbackNumericFormat::create
(
const
QVariantMap &,
const
QgsReadWriteContext
& )
const
49
{
50
return
new
QgsFallbackNumericFormat
();
51
}
52
53
QVariantMap
QgsFallbackNumericFormat::configuration
(
const
QgsReadWriteContext
& )
const
54
{
55
return
QVariantMap();
56
}
QgsFallbackNumericFormat::create
QgsNumericFormat * create(const QVariantMap &configuration, const QgsReadWriteContext &context) const override
Creates a new copy of the format, using the supplied configuration.
Definition
qgsfallbacknumericformat.cpp:48
QgsFallbackNumericFormat::configuration
QVariantMap configuration(const QgsReadWriteContext &context) const override
Returns the current configuration of the formatter.
Definition
qgsfallbacknumericformat.cpp:53
QgsFallbackNumericFormat::visibleName
QString visibleName() const override
Returns the translated, user-visible name for this format.
Definition
qgsfallbacknumericformat.cpp:28
QgsFallbackNumericFormat::sortKey
int sortKey() override
Returns a sorting key value, where formats with a lower sort key will be shown earlier in lists.
Definition
qgsfallbacknumericformat.cpp:33
QgsFallbackNumericFormat::QgsFallbackNumericFormat
QgsFallbackNumericFormat()=default
QgsFallbackNumericFormat::clone
QgsNumericFormat * clone() const override
Clones the format, returning a new object.
Definition
qgsfallbacknumericformat.cpp:43
QgsFallbackNumericFormat::formatDouble
QString formatDouble(double value, const QgsNumericFormatContext &context) const override
Returns a formatted string representation of a numeric double value.
Definition
qgsfallbacknumericformat.cpp:38
QgsFallbackNumericFormat::id
QString id() const override
Returns a unique id for this numeric format.
Definition
qgsfallbacknumericformat.cpp:23
QgsNumericFormatContext
A context for numeric formats.
Definition
qgsnumericformat.h:35
QgsNumericFormat::QgsNumericFormat
QgsNumericFormat()=default
QgsReadWriteContext
A container for the context for various read/write operations on objects.
Definition
qgsreadwritecontext.h:38
qgsfallbacknumericformat.h
Generated on
for QGIS API Documentation by
1.15.0