Skip to content

Commit 33fe8fa

Browse files
committed
Always use the QgsField precision value as a default for the reange widget
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.
1 parent c50e1bf commit 33fe8fa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/gui/editorwidgets/qgsrangewidgetwrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ void QgsRangeWidgetWrapper::initWidget( QWidget *editor )
9292
double stepval = step.isValid() ? step.toDouble() : 1.0;
9393
double minval = min.isValid() ? min.toDouble() : std::numeric_limits<double>::lowest();
9494
double maxval = max.isValid() ? max.toDouble() : std::numeric_limits<double>::max();
95-
int precisionval = precision.isValid() ? precision.toInt() : 4;
95+
int precisionval = precision.isValid() ? precision.toInt() : layer()->fields().at( fieldIdx() ).precision();
9696

9797
mDoubleSpinBox->setDecimals( precisionval );
9898

0 commit comments

Comments
 (0)