From: ouv Date: Thu, 10 Dec 2009 08:28:41 +0000 (+0000) Subject: Debug X-Git-Tag: PHASE_17_Part1_V3~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ef60401d6ac7e657638db9a02682c69f632a293d;p=modules%2Fgui.git Debug --- diff --git a/src/SalomeApp/SalomeApp_Notebook.cxx b/src/SalomeApp/SalomeApp_Notebook.cxx index d4bc435a8..6008f139c 100644 --- a/src/SalomeApp/SalomeApp_Notebook.cxx +++ b/src/SalomeApp/SalomeApp_Notebook.cxx @@ -111,6 +111,31 @@ QVariant SalomeApp_Notebook::calculate( const QString& theExpr ) return convert( aParam.in() ); } +QVariant::Type SalomeApp_Notebook::getType( const QString& theName ) +{ + QVariant::Type aRes = QVariant::Invalid; + SALOME::Parameter_var aParam = myNotebook->GetParameter( theName.toLatin1().constData() ); + if( !CORBA::is_nil( aParam ) ) + switch( aParam->GetType() ) + { + case SALOME::TBoolean: + aRes = QVariant::Bool; + break; + case SALOME::TInteger: + aRes = QVariant::Int; + break; + case SALOME::TReal: + aRes = QVariant::Double; + break; + case SALOME::TString: + aRes = QVariant::String; + break; + default: + break; + } + return aRes; +} + bool SalomeApp_Notebook::isValid( const QString& theName ) const { QMap::const_iterator it = myRecentValues.find( theName ); diff --git a/src/SalomeApp/SalomeApp_Notebook.h b/src/SalomeApp/SalomeApp_Notebook.h index 5507daa67..01301dc2c 100644 --- a/src/SalomeApp/SalomeApp_Notebook.h +++ b/src/SalomeApp/SalomeApp_Notebook.h @@ -31,10 +31,10 @@ #include #include +#include class SalomeApp_Study; class QString; -class QVariant; class QStringList; class QAbstractSpinBox; @@ -55,6 +55,8 @@ public: QString expression( const QString& theName ) const; QVariant calculate( const QString& theExpr ); + QVariant::Type getType( const QString& theName ); + bool isValid( const QString& theName ) const; void update();