0020580: EDF 1169 GEOM: float number precision in dialog boxes

Additional small bug fix (resources) in sketcher dialog box
This commit is contained in:
vsr 2010-06-04 11:52:29 +00:00
parent 7c20a00c5f
commit d68a9a9601

View File

@ -1653,15 +1653,15 @@ void EntityGUI_SketcherDlg::initSpinBox( SalomeApp_DoubleSpinBox* spinBox,
int aPrecision = resMgr->integerValue( "Geometry", quantity, 6 );
spinBox->setPrecision( aPrecision );
spinBox->setDecimals( aPrecision ); // it's necessary to set decimals before the range setting,
// by default Qt rounds boundaries to 2 decimals at setRange
spinBox->setDecimals( qAbs( aPrecision ) ); // it's necessary to set decimals before the range setting,
// by default Qt rounds boundaries to 2 decimals at setRange
spinBox->setRange( min, max );
spinBox->setSingleStep( step );
// Add a hint for the user saying how to tune precision
QString userPropName = QObject::tr( QString( "PREF_%1" ).arg( quantity ).toLatin1().constData() );
QString userPropName = QObject::tr( QString( "GEOM_PREF_%1" ).arg( quantity ).toLatin1().constData() );
spinBox->setProperty( "validity_tune_hint",
QVariant( QObject::tr( "PRECISION_HINT" ).arg( userPropName ) ) );
QVariant( QObject::tr( "GEOM_PRECISION_HINT" ).arg( userPropName ) ) );
}
//=================================================================================