From: stv Date: Sun, 26 Feb 2006 06:14:19 +0000 (+0000) Subject: Updated SALOME GUI sources for building under Ms Visual .NET on Windows platform. X-Git-Tag: LAST_STABLE_VERSION_21_09_2006_ON_3_2_0~91 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=413125b51dfd543cec90c2749f388882fd787ae4;p=modules%2Fgui.git Updated SALOME GUI sources for building under Ms Visual .NET on Windows platform. --- diff --git a/src/QDS/QDS.cxx b/src/QDS/QDS.cxx index e6bdd56c8..ec925779e 100644 --- a/src/QDS/QDS.cxx +++ b/src/QDS/QDS.cxx @@ -146,7 +146,7 @@ void QDS::setActiveUnitSystem( const QString& sys, const QString& comp ) for ( QValueList::iterator it = _datumList.begin(); it != _datumList.end(); ++it ) { QDS_Datum* datum = *it; - if ( !datum ) + if ( !datum || !datum->flags( AutoUnits ) ) continue; bool ok = aComp.IsEmpty(); diff --git a/src/QDS/QDS.h b/src/QDS/QDS.h index c9ff5edd0..3b20b2378 100644 --- a/src/QDS/QDS.h +++ b/src/QDS/QDS.h @@ -32,7 +32,7 @@ class QDS_EXPORT QDS public: typedef enum { None = 0x00, Label = 0x01, Control = 0x02, Units = 0x04, NotFormat = 0x08, NotAccel = 0x10, UnitsWithLabel = 0x20, - All = Label | Control | Units } DatumFlags; + AutoUnits = 0x40, All = Label | Control | Units } DatumFlags; public: static bool load( const QString& ); diff --git a/src/QDS/QDS_Datum.cxx b/src/QDS/QDS_Datum.cxx index f7a76b649..70f3169c8 100644 --- a/src/QDS/QDS_Datum.cxx +++ b/src/QDS/QDS_Datum.cxx @@ -390,6 +390,20 @@ void QDS_Datum::clear() } } +void QDS_Datum::updateUnits() +{ + Handle(DDS_DicItem) item = dicItem(); + if ( item.IsNull() ) + return; + + unitSystemChanged( activeUnitSystem( toQString( item->GetComponent() ) ) ); +} + +bool QDS_Datum::flags( const int f ) const +{ + return ( myFlags & f ) == f; +} + void QDS_Datum::setValue( const QVariant& val ) { if ( val.isValid() && val.canCast( QVariant::String ) ) diff --git a/src/QDS/QDS_Datum.h b/src/QDS/QDS_Datum.h index 3a1a92985..cafd76437 100644 --- a/src/QDS/QDS_Datum.h +++ b/src/QDS/QDS_Datum.h @@ -3,7 +3,7 @@ #include "QDS.h" -#include +#include #include #include #include @@ -55,6 +55,9 @@ public: virtual void reset(); virtual void clear(); + void updateUnits(); + bool flags( const int ) const; + virtual void setValue( const QVariant& ); virtual void setStringValue( const QString& );