Skip to content
Permalink
Browse files

Always use the QgsField precision value as a default for the reange w…

…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 33fe8fab7ac258d98cebf8c0ad7e315bff449a14
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/gui/editorwidgets/qgsrangewidgetwrapper.cpp
@@ -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 );

0 comments on commit 33fe8fa

Please sign in to comment.
You can’t perform that action at this time.