mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Get config from arguments instead of querying fields
This commit is contained in:
parent
29f6484dd0
commit
37f31dd809
@ -53,14 +53,14 @@ QString QgsRangeFieldFormatter::representValue( QgsVectorLayer *layer, int field
|
||||
const QgsField field = layer->fields().at( fieldIndex );
|
||||
|
||||
if ( field.type() == QVariant::Double &&
|
||||
field.editorWidgetSetup().config().contains( QStringLiteral( "Precision" ) ) &&
|
||||
config.contains( QStringLiteral( "Precision" ) ) &&
|
||||
value.isValid( ) )
|
||||
{
|
||||
bool ok;
|
||||
double val( value.toDouble( &ok ) );
|
||||
if ( ok )
|
||||
{
|
||||
int precision( field.editorWidgetSetup().config()[ QStringLiteral( "Precision" ) ].toInt( &ok ) );
|
||||
int precision( config[ QStringLiteral( "Precision" ) ].toInt( &ok ) );
|
||||
if ( ok )
|
||||
{
|
||||
// TODO: make the format configurable!
|
||||
|
Loading…
x
Reference in New Issue
Block a user