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 6e007bf
Showing 1 changed file with 9 additions and 2 deletions.
@@ -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.