28 return QStringLiteral(
"Range" );
44 std::function<QLocale()> f_locale = [ ]
47 QLocale::NumberOptions options( locale.numberOptions() );
48 options |= QLocale::NumberOption::OmitGroupSeparator;
49 locale.setNumberOptions( options );
55 if ( field.
type() == QVariant::Double &&
56 config.contains( QStringLiteral(
"Precision" ) ) &&
60 double val( value.toDouble( &ok ) );
63 int precision( config[ QStringLiteral(
"Precision" ) ].toInt( &ok ) );
67 result = f_locale().toString( val,
'f', precision );
71 else if ( ( field.
type() == QVariant::Int ) &&
75 double val( value.toInt( &ok ) );
78 result = f_locale().toString( val,
'f', 0 );
81 else if ( ( field.
type() == QVariant::LongLong ) &&
85 double val( value.toLongLong( &ok ) );
88 result = f_locale().toString( val,
'f', 0 );
93 result = value.toString();
static QgsApplication * instance()
Returns the singleton instance of the QgsApplication.
QgsField at(int i) const
Get field at particular index (must be in range 0..N-1)
QgsFields fields() const override
Returns the list of fields of this layer.
static QString nullRepresentation()
This string is used to represent the value NULL throughout QGIS.
Encapsulate a field in an attribute table or data source.
Represents a vector layer which manages a vector based data sets.