From ef60401d6ac7e657638db9a02682c69f632a293d Mon Sep 17 00:00:00 2001 From: ouv Date: Thu, 10 Dec 2009 08:28:41 +0000 Subject: [PATCH] Debug --- src/SalomeApp/SalomeApp_Notebook.cxx | 25 +++++++++++++++++++++++++ src/SalomeApp/SalomeApp_Notebook.h | 4 +++- 2 files changed, 28 insertions(+), 1 deletion(-) 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(); -- 2.39.2