From: nds Date: Wed, 11 Jun 2014 08:00:23 +0000 (+0400) Subject: Init feature by model widget factory content X-Git-Tag: V_0.4.4~291 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a8d0fddcc65db1fe234df36354b6735918075a70;p=modules%2Fshaper.git Init feature by model widget factory content The code is moved here to be applyed for all types of features. --- diff --git a/src/ModuleBase/ModuleBase_WidgetFactory.cpp b/src/ModuleBase/ModuleBase_WidgetFactory.cpp index e52d5b2d4..239b3eda3 100644 --- a/src/ModuleBase/ModuleBase_WidgetFactory.cpp +++ b/src/ModuleBase/ModuleBase_WidgetFactory.cpp @@ -155,9 +155,6 @@ QWidget* ModuleBase_WidgetFactory::doubleSpinBoxControl(QWidget* theParent) myModelWidgets.append(aDblWgt); - // Init default values - if (!myOperation->isEditOperation()) - aDblWgt->storeValue(myOperation->feature()); return aDblWgt->getControl(); } @@ -207,8 +204,5 @@ QWidget* ModuleBase_WidgetFactory::booleanControl(QWidget* theParent) myModelWidgets.append(aBoolWgt); - // Init default values - if (!myOperation->isEditOperation()) - aBoolWgt->storeValue(myOperation->feature()); return aBoolWgt->getControl(); } \ No newline at end of file diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index c4c6ac939..24fea8453 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -317,6 +317,16 @@ void XGUI_Workshop::onOperationStarted() QWidget* aContent = myPropertyPanel->contentWidget(); qDeleteAll(aContent->children()); aFactory.createWidget(aContent); + + // Init default values + if (!aOperation->isEditOperation()) { + QList aWidgets = aFactory.getModelWidgets(); + QList::const_iterator anIt = aWidgets.begin(), aLast = aWidgets.end(); + for (; anIt != aLast; anIt++) { + (*anIt)->storeValue(aOperation->feature()); + } + } + myPropertyPanel->setModelWidgets(aFactory.getModelWidgets()); myPropertyPanel->setWindowTitle(aOperation->getDescription()->description()); }