From 413125b51dfd543cec90c2749f388882fd787ae4 Mon Sep 17 00:00:00 2001 From: stv Date: Sun, 26 Feb 2006 06:14:19 +0000 Subject: [PATCH] Updated SALOME GUI sources for building under Ms Visual .NET on Windows platform. --- src/QDS/QDS.cxx | 2 +- src/QDS/QDS.h | 2 +- src/QDS/QDS_Datum.cxx | 14 ++++++++++++++ src/QDS/QDS_Datum.h | 5 ++++- 4 files changed, 20 insertions(+), 3 deletions(-) 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& ); -- 2.39.2