mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Use field precision for range edit spin
This commit is contained in:
parent
ae19eefb36
commit
6e007bf7da
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user