void VisuGUI::createPreferences()
{
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+
// TAB: "MED import"
int importTab = addPreference( tr( "MED import" ) );
//printf( "++++++++++++++++++ Tab index %d\n", importTab );
int imposedGr = addPreference( tr( "VISU_MINMAX_IMPOSED_RANGE" ), sbarTab );
setPreferenceProperty( imposedGr, "columns", 4 );
- int min = addPreference( tr( "VISU_MIN" ), imposedGr, LightApp_Preferences::DblSpin, "VISU", "scalar_range_min" );
- int max = addPreference( tr( "VISU_MAX" ), imposedGr, LightApp_Preferences::DblSpin, "VISU", "scalar_range_max" );
- setPreferenceProperty( min, "step", 0.1 );
- setPreferenceProperty( max, "step", 0.1 );
+ int min = addPreference( tr( "VISU_MIN" ), imposedGr, LightApp_Preferences::Double, "VISU", "scalar_range_min" );
+ int max = addPreference( tr( "VISU_MAX" ), imposedGr, LightApp_Preferences::Double, "VISU", "scalar_range_max" );
+ setPreferenceProperty( min, "precision", aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 ) );
+ setPreferenceProperty( max, "precision", aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 ) );
+ //setPreferenceProperty( min, "step", 0.1 );
+ //setPreferenceProperty( max, "step", 0.1 );
// group: "Font"
int fontGr = addPreference( tr( "VISU_FONT" ), sbarTab );
aResourceMgr->setValue("VISU", "scalar_bar_horizontal_height",sbH);
}
}
+ else if(b == "floating_point_precision") {
+ LightApp_Preferences* pref = preferences();
+ QtxPreferenceItem* min = pref->findItem( tr( "VISU_MIN" ), true );
+ QtxPreferenceItem* max = pref->findItem( tr( "VISU_MAX" ), true );
+ if ( min )
+ setPreferenceProperty( min->id(), "precision", aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 ) );
+ if ( max )
+ setPreferenceProperty( max->id(), "precision", aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 ) );
+ }
if ( !aWarning.isEmpty() ){
aWarning += "The default values are applied instead.";
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
int aPrecision = aResourceMgr->integerValue("VISU", "floating_point_precision", 0);
- MinEdit->setText(QString::number(imin, 'g', aPrecision));
- MaxEdit->setText(QString::number(imax, 'g', aPrecision));
+ MinEdit->setText(QString::number(imin, 'g', aPrecision+1)); // VSR +1 is for 'g' format
+ MaxEdit->setText(QString::number(imax, 'g', aPrecision+1)); // VSR +1 is for 'g' format
if( sbRange )
RBIrange->setChecked( true );