Skip to content

Commit

Permalink
Use field precision for range edit spin
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro authored and m-kuhn committed Jul 24, 2014
1 parent ae19eef commit 6e007bf
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/gui/editorwidgets/qgsrangewidget.cpp
Expand Up @@ -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:
Expand Down

0 comments on commit 6e007bf

Please sign in to comment.