QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
Public Member Functions | List of all members
QgsFallbackNumericFormat Class Reference

A basic numeric formatter which returns a simple text representation of a value. More...

#include <qgsfallbacknumericformat.h>

Inheritance diagram for QgsFallbackNumericFormat:
Inheritance graph
[legend]

Public Member Functions

 QgsFallbackNumericFormat ()=default
 Default constructor. More...
 
QgsNumericFormatclone () const override
 Clones the format, returning a new object. More...
 
QVariantMap configuration (const QgsReadWriteContext &context) const override
 Returns the current configuration of the formatter. More...
 
QgsNumericFormatcreate (const QVariantMap &configuration, const QgsReadWriteContext &context) const override
 Creates a new copy of the format, using the supplied configuration. More...
 
QString formatDouble (double value, const QgsNumericFormatContext &context) const override
 Returns a formatted string representation of a numeric double value. More...
 
QString id () const override
 Returns a unique id for this numeric format. More...
 
int sortKey () override
 Returns a sorting key value, where formats with a lower sort key will be shown earlier in lists. More...
 
QString visibleName () const override
 Returns the translated, user-visible name for this format. More...
 
- Public Member Functions inherited from QgsNumericFormat
 QgsNumericFormat ()=default
 Default constructor. More...
 
virtual ~QgsNumericFormat ()=default
 
virtual QgsNumericFormatclone () const =0
 Clones the format, returning a new object. More...
 
virtual QVariantMap configuration (const QgsReadWriteContext &context) const =0
 Returns the current configuration of the formatter. More...
 
virtual QgsNumericFormatcreate (const QVariantMap &configuration, const QgsReadWriteContext &context) const =0
 Creates a new copy of the format, using the supplied configuration. More...
 
virtual QString formatDouble (double value, const QgsNumericFormatContext &context) const =0
 Returns a formatted string representation of a numeric double value. More...
 
virtual QString id () const =0
 Returns a unique id for this numeric format. More...
 
bool operator!= (const QgsNumericFormat &other) const
 
bool operator== (const QgsNumericFormat &other) const
 
virtual int sortKey ()
 Returns a sorting key value, where formats with a lower sort key will be shown earlier in lists. More...
 
virtual double suggestSampleValue () const
 Returns a suggested sample value which nicely represents the current format configuration. More...
 
virtual QString visibleName () const =0
 Returns the translated, user-visible name for this format. More...
 
void writeXml (QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const
 Writes the format to an XML element. More...
 

Additional Inherited Members

- Static Protected Attributes inherited from QgsNumericFormat
static constexpr int DEFAULT_SORT_KEY = 100
 

Detailed Description

A basic numeric formatter which returns a simple text representation of a value.

Since
QGIS 3.12

Definition at line 28 of file qgsfallbacknumericformat.h.

Constructor & Destructor Documentation

◆ QgsFallbackNumericFormat()

QgsFallbackNumericFormat::QgsFallbackNumericFormat ( )
default

Default constructor.

Member Function Documentation

◆ clone()

QgsNumericFormat * QgsFallbackNumericFormat::clone ( ) const
overridevirtual

Clones the format, returning a new object.

The caller takes ownership of the returned object.

Implements QgsNumericFormat.

Definition at line 40 of file qgsfallbacknumericformat.cpp.

◆ configuration()

QVariantMap QgsFallbackNumericFormat::configuration ( const QgsReadWriteContext context) const
overridevirtual

Returns the current configuration of the formatter.

This value can be used in a call to create() in order to recreate this formatter in its current state.

Implements QgsNumericFormat.

Definition at line 50 of file qgsfallbacknumericformat.cpp.

◆ create()

QgsNumericFormat * QgsFallbackNumericFormat::create ( const QVariantMap &  configuration,
const QgsReadWriteContext context 
) const
overridevirtual

Creates a new copy of the format, using the supplied configuration.

The caller takes ownership of the returned object.

Implements QgsNumericFormat.

Definition at line 45 of file qgsfallbacknumericformat.cpp.

◆ formatDouble()

QString QgsFallbackNumericFormat::formatDouble ( double  value,
const QgsNumericFormatContext context 
) const
overridevirtual

Returns a formatted string representation of a numeric double value.

Implements QgsNumericFormat.

Definition at line 35 of file qgsfallbacknumericformat.cpp.

◆ id()

QString QgsFallbackNumericFormat::id ( ) const
overridevirtual

Returns a unique id for this numeric format.

This id is used to identify this numeric format in the registry with QgsNumericFormatRegistry::format().

Implements QgsNumericFormat.

Definition at line 20 of file qgsfallbacknumericformat.cpp.

◆ sortKey()

int QgsFallbackNumericFormat::sortKey ( )
overridevirtual

Returns a sorting key value, where formats with a lower sort key will be shown earlier in lists.

Generally, subclasses should return QgsNumericFormat::sortKey() as their sorting key.

Reimplemented from QgsNumericFormat.

Definition at line 30 of file qgsfallbacknumericformat.cpp.

◆ visibleName()

QString QgsFallbackNumericFormat::visibleName ( ) const
overridevirtual

Returns the translated, user-visible name for this format.

Implements QgsNumericFormat.

Definition at line 25 of file qgsfallbacknumericformat.cpp.


The documentation for this class was generated from the following files: