Skip to content

Commit

Permalink
Always use the QgsField precision value as a default for the reange w…
Browse files Browse the repository at this point in the history
…idget

Instead of interpreting a 0 like a default and get a 2 as the precision.

But now you can set the precision you like just configuring the widget.
  • Loading branch information
elpaso committed Jan 30, 2018
1 parent c50e1bf commit 33fe8fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/editorwidgets/qgsrangewidgetwrapper.cpp
Expand Up @@ -92,7 +92,7 @@ void QgsRangeWidgetWrapper::initWidget( QWidget *editor )
double stepval = step.isValid() ? step.toDouble() : 1.0;
double minval = min.isValid() ? min.toDouble() : std::numeric_limits<double>::lowest();
double maxval = max.isValid() ? max.toDouble() : std::numeric_limits<double>::max();
int precisionval = precision.isValid() ? precision.toInt() : 4;
int precisionval = precision.isValid() ? precision.toInt() : layer()->fields().at( fieldIdx() ).precision();

mDoubleSpinBox->setDecimals( precisionval );

Expand Down

0 comments on commit 33fe8fa

Please sign in to comment.