From 47227b1b5a97827014aec1f3128ca7acb10835da Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 11 Nov 2011 05:20:40 +0000 Subject: [PATCH] Merge debug for TRIPOLI (V6_1_BR, 11/11/11) --- src/QDS/QDS.h | 15 ++++++++------- src/QDS/QDS_ComboBox.cxx | 4 ++-- src/QDS/QDS_Datum.cxx | 8 ++++---- src/SUIT/SUIT_Accel.cxx | 13 ++++++++----- src/SUIT/SUIT_ViewWindow.cxx | 2 +- 5 files changed, 23 insertions(+), 19 deletions(-) diff --git a/src/QDS/QDS.h b/src/QDS/QDS.h index 54538751b..a24eabbae 100644 --- a/src/QDS/QDS.h +++ b/src/QDS/QDS.h @@ -53,13 +53,14 @@ public: //! Enum describes bit flags of the Qt datum view and behaviour typedef enum { - None = 0x00, //!< Non specified any flags (Default behaviour) - Label = 0x01, //!< Create subwidget for datum label - Control = 0x02, //!< Create subwidget for datum input control - Units = 0x04, //!< Create subwidget for datum units of measure - NotFormat = 0x08, //!< Don't format initial value - NotAccel = 0x10, //!< Not support accelerators in datum label - UnitsWithLabel = 0x20, //!< Display units of measure in label like " () instead separate text" + None = 0x00, //!< Non specified any flags (Default behaviour) + Label = 0x01, //!< Create subwidget for datum label + Control = 0x02, //!< Create subwidget for datum input control + Units = 0x04, //!< Create subwidget for datum units of measure + NotFormat = 0x08, //!< Don't format initial value + NotAccel = 0x10, //!< Not support accelerators in datum label + NotConvert = 0x20, //!< Don't convert numeric value + UnitsWithLabel = 0x40, //!< Display units of measure in label like " () instead separate text" All = Label | Control | Units //!< Create all subwidgets } DatumFlags; diff --git a/src/QDS/QDS_ComboBox.cxx b/src/QDS/QDS_ComboBox.cxx index 64410aea1..608dbe5ee 100644 --- a/src/QDS/QDS_ComboBox.cxx +++ b/src/QDS/QDS_ComboBox.cxx @@ -410,11 +410,11 @@ void QDS_ComboBox::setString( const QString& txt ) else if ( txt.isEmpty() ) { if ( !cb->isEditable() ) - cb->setItemText( cb->currentIndex(), txt ); + cb->setCleared( true ); else cb->lineEdit()->setText( txt ); } - if ( isClear != txt.isEmpty() || ( !isClear && old != cb->currentIndex() ) ) + if ( isClear != txt.isEmpty() || ( !isClear && old != cb->currentIndex() ) || isClear != cb->isCleared() ) { onParamChanged(); QString str = getString(); diff --git a/src/QDS/QDS_Datum.cxx b/src/QDS/QDS_Datum.cxx index 56dd594d6..ec0b53b48 100644 --- a/src/QDS/QDS_Datum.cxx +++ b/src/QDS/QDS_Datum.cxx @@ -588,7 +588,7 @@ double QDS_Datum::doubleValue() const else { res = getString().toDouble(); - if ( !myDicItem.IsNull() ) + if ( !myDicItem.IsNull() && !( flags() & NotConvert ) ) res = myDicItem->ToSI( res ); } @@ -613,7 +613,7 @@ int QDS_Datum::integerValue() const else { double val = getString().toDouble(); - if ( !myDicItem.IsNull() ) + if ( !myDicItem.IsNull() && !( flags() & NotConvert ) ) res = (int)myDicItem->ToSI( val ); } @@ -738,7 +738,7 @@ void QDS_Datum::setDoubleValue( const double num ) mySourceValue = QString().setNum( num, 'g', 16 ); double val = num; - if ( !myDicItem.IsNull() ) + if ( !myDicItem.IsNull() && !( flags() & NotConvert ) ) val = myDicItem->FromSI( val ); QString aStr = format( ( flags() & NotFormat ) ? (QString) "" : format(), type(), val ); @@ -766,7 +766,7 @@ void QDS_Datum::setIntegerValue( const int num ) mySourceValue = QString().setNum( num ); double val = num; - if ( !myDicItem.IsNull() ) + if ( !myDicItem.IsNull() && !( flags() & NotConvert ) ) val = myDicItem->FromSI( val ); QString aStr = format( ( flags() & NotFormat ) ? (QString) "" : format(), type(), val ); diff --git a/src/SUIT/SUIT_Accel.cxx b/src/SUIT/SUIT_Accel.cxx index fafcaf84b..6f96bd19c 100644 --- a/src/SUIT/SUIT_Accel.cxx +++ b/src/SUIT/SUIT_Accel.cxx @@ -131,11 +131,14 @@ bool SUIT_Accel::eventFilter( QObject *obj, QEvent *event ) if ( key ) { SUIT_ViewWindow* vw = ::getParentViewWindow( obj ); if ( vw ) { - QString type = vw->getViewManager()->getViewModel()->getType(); - if ( myMap.contains( type ) ) { - IdActionMap idActionMap = myMap[type]; - if ( idActionMap.contains( key ) ) { - return vw->onAccelAction( idActionMap[key] ); + if ( vw->getViewManager() && vw->getViewManager()->getViewModel() ) + { + QString type = vw->getViewManager()->getViewModel()->getType(); + if ( myMap.contains( type ) ) { + IdActionMap idActionMap = myMap[type]; + if ( idActionMap.contains( key ) ) { + return vw->onAccelAction( idActionMap[key] ); + } } } } diff --git a/src/SUIT/SUIT_ViewWindow.cxx b/src/SUIT/SUIT_ViewWindow.cxx index 85ceaac33..0786944b4 100755 --- a/src/SUIT/SUIT_ViewWindow.cxx +++ b/src/SUIT/SUIT_ViewWindow.cxx @@ -47,7 +47,7 @@ const int DUMP_EVENT = QEvent::User + 123; /*! Constructor.*/ SUIT_ViewWindow::SUIT_ViewWindow( SUIT_Desktop* theDesktop ) - : QMainWindow( theDesktop ), myIsDropDown( true ) + : QMainWindow( theDesktop ), myManager( 0 ), myIsDropDown( true ) { myDesktop = theDesktop; -- 2.39.2