void VisuGUI::createPreferences()
{
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+
// TAB: General
int genTab = addPreference( tr( "VISU_PREF_GENERAL" ) );
// Quantities with individual precision settings
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, "min", -1.e12 );
- setPreferenceProperty( min, "max", 1.e12 );
- setPreferenceProperty( min, "step", 0.1 );
- setPreferenceProperty( min, "precision", -12 );
-
- setPreferenceProperty( max, "min", -1.e12 );
- setPreferenceProperty( max, "max", 1.e12 );
- setPreferenceProperty( max, "step", 0.1 );
- setPreferenceProperty( max, "precision", -12 );
+ 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, "decimals", qAbs( aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ) ) );
+ setPreferenceProperty( max, "decimals", qAbs( aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ) ) );
// group: "Font"
int fontGr = addPreference( tr( "VISU_FONT" ), sbarTab );
addPreference( tr( "VISU_EDGE_COLOR" ), representGr, LightApp_Preferences::Color, "VISU", "edge_color" );
addPreference( "", representGr, LightApp_Preferences::Space );
- SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
-
int typeOfMarker = addPreference( tr( "VISU_TYPE_OF_MARKER" ), representGr, LightApp_Preferences::Selector, "VISU", "type_of_marker" );
QList<QVariant> aMarkerTypeIndicesList;
aResourceMgr->setValue("VISU", "scalar_bar_horizontal_height",sbH);
}
}
+ else if(b == "visual_data_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(), "decimals", qAbs( aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ) ) );
+ if ( max )
+ setPreferenceProperty( max->id(), "decimals", qAbs( aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ) ) );
+ }
if ( !aWarning.isEmpty() ){
aWarning += "The default values are applied instead.";