From 036be279a4ab48c58fc6a5d08d9815d34208d503 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 30 May 2013 14:20:00 +0000 Subject: [PATCH] 0022104: EDF 2550 SMESH: 2D viscous layer, allow specifying edges with viscous layer Provide access to QLabel's of parameters: + QLabel* getLabel(int i) const; + ListOfWidgets myParamLabels; --- src/SMESHGUI/SMESHGUI_Hypotheses.cxx | 17 +++++++++++++++++ src/SMESHGUI/SMESHGUI_Hypotheses.h | 2 ++ 2 files changed, 19 insertions(+) diff --git a/src/SMESHGUI/SMESHGUI_Hypotheses.cxx b/src/SMESHGUI/SMESHGUI_Hypotheses.cxx index da396be6f..a6e19527b 100644 --- a/src/SMESHGUI/SMESHGUI_Hypotheses.cxx +++ b/src/SMESHGUI/SMESHGUI_Hypotheses.cxx @@ -185,6 +185,7 @@ QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame() { QLabel* lab = new QLabel( (*anIt).myName, GroupC1 ); GroupC1Layout->addWidget( lab, i, 0 ); + myParamLabels << lab; QWidget* w = getCustomWidget( *anIt, GroupC1, i ); if ( !w ) @@ -466,6 +467,22 @@ SMESHGUI_GenericHypothesisCreator::ListOfWidgets& SMESHGUI_GenericHypothesisCrea return myParamWidgets; } +//================================================================================ +/*! + * \brief Returns a QLabel of a spesified parameter. + * If isCreation(), the 1st label (supposed to be "Name") is not countered. + */ +//================================================================================ + +QLabel* SMESHGUI_GenericHypothesisCreator::getLabel(int i) const +{ + if ( isCreation() ) + i++; + if ( i < myParamLabels.size() ) + return (QLabel*) myParamLabels.at(i); + return NULL; +} + QtxDialog* SMESHGUI_GenericHypothesisCreator:: dlg() const { return myDlg; diff --git a/src/SMESHGUI/SMESHGUI_Hypotheses.h b/src/SMESHGUI/SMESHGUI_Hypotheses.h index 475763191..83da609d3 100644 --- a/src/SMESHGUI/SMESHGUI_Hypotheses.h +++ b/src/SMESHGUI/SMESHGUI_Hypotheses.h @@ -99,6 +99,7 @@ protected: bool hasInitParamsHypothesis() const; const ListOfWidgets& widgets() const; ListOfWidgets& changeWidgets(); + QLabel* getLabel(int i) const; QtxDialog* dlg() const; QString getVariableName(const char* methodName) const; @@ -134,6 +135,7 @@ private: QString myHypName; QString myHypType; ListOfWidgets myParamWidgets; + ListOfWidgets myParamLabels; bool myIsCreate; QtxDialog* myDlg; QString myShapeEntry; -- 2.39.2