Skip to content
Permalink
Browse files

Use field precision for range edit spin

  • Loading branch information
manisandro authored and m-kuhn committed Jul 24, 2014
1 parent ae19eef commit 6e007bf7dab67485b58d8b96ab6e5285cd4e2e83
Showing with 9 additions and 2 deletions.
  1. +9 −2 src/gui/editorwidgets/qgsrangewidget.cpp
@@ -43,9 +43,16 @@ QWidget* QgsRangeWidget::createWidget( QWidget* parent )
switch ( layer()->pendingFields()[fieldIdx()].type() )
{
case QVariant::Double:
editor = new QDoubleSpinBox( parent );
{
QDoubleSpinBox* spin = new QDoubleSpinBox( parent );
int precision = layer()->pendingFields()[fieldIdx()].precision();
if ( precision > 0 )
{
spin->setDecimals( layer()->pendingFields()[fieldIdx()].precision() );
}
editor = spin;
break;

}
case QVariant::Int:
case QVariant::LongLong:
default:

0 comments on commit 6e007bf

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