QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
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
18
20{
21 return QStringLiteral( "default" );
22}
23
25{
26 return QObject::tr( "General" );
27}
28
30{
31 return 0;
32}
33
35{
36 return QString::number( value );
37}
38
43
45{
46 return new QgsFallbackNumericFormat();
47}
48
50{
51 return QVariantMap();
52}
QgsNumericFormat * create(const QVariantMap &configuration, const QgsReadWriteContext &context) const override
Creates a new copy of the format, using the supplied configuration.
QVariantMap configuration(const QgsReadWriteContext &context) const override
Returns the current configuration of the formatter.
QString visibleName() const override
Returns the translated, user-visible name for this format.
int sortKey() override
Returns a sorting key value, where formats with a lower sort key will be shown earlier in lists.
QgsFallbackNumericFormat()=default
QgsNumericFormat * clone() const override
Clones the format, returning a new object.
QString formatDouble(double value, const QgsNumericFormatContext &context) const override
Returns a formatted string representation of a numeric double value.
QString id() const override
Returns a unique id for this numeric format.
A context for numeric formats.
QgsNumericFormat()=default
A container for the context for various read/write operations on objects.