QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
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 
19 
21 {
22  return QStringLiteral( "default" );
23 }
24 
26 {
27  return QObject::tr( "General" );
28 }
29 
31 {
32  return 0;
33 }
34 
36 {
37  return QString::number( value );
38 }
39 
41 {
42  return new QgsFallbackNumericFormat();
43 }
44 
46 {
47  return new QgsFallbackNumericFormat();
48 }
49 
51 {
52  return QVariantMap();
53 }
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:30
qgsfallbacknumericformat.h
QgsReadWriteContext
The class is used as a container of context for various read/write operations on other objects.
Definition: qgsreadwritecontext.h:35
QgsNumericFormat
A numeric formatter allows for formatting a numeric value for display, using a variety of different f...
Definition: qgsnumericformat.h:218
QgsFallbackNumericFormat::formatDouble
QString formatDouble(double value, const QgsNumericFormatContext &context) const override
Returns a formatted string representation of a numeric double value.
Definition: qgsfallbacknumericformat.cpp:35
QgsFallbackNumericFormat::QgsFallbackNumericFormat
QgsFallbackNumericFormat()=default
Default constructor.
QgsFallbackNumericFormat::configuration
QVariantMap configuration(const QgsReadWriteContext &context) const override
Returns the current configuration of the formatter.
Definition: qgsfallbacknumericformat.cpp:50
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:45
QgsFallbackNumericFormat::visibleName
QString visibleName() const override
Returns the translated, user-visible name for this format.
Definition: qgsfallbacknumericformat.cpp:25
QgsFallbackNumericFormat::clone
QgsNumericFormat * clone() const override
Clones the format, returning a new object.
Definition: qgsfallbacknumericformat.cpp:40
QgsNumericFormatContext
A context for numeric formats.
Definition: qgsnumericformat.h:35
QgsFallbackNumericFormat::id
QString id() const override
Returns a unique id for this numeric format.
Definition: qgsfallbacknumericformat.cpp:20