]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #18737 (Tuleap): Update viewer on show preview command
authorvsv <vsv@opencascade.com>
Fri, 6 Mar 2020 09:25:13 +0000 (12:25 +0300)
committervsv <vsv@opencascade.com>
Fri, 6 Mar 2020 09:25:13 +0000 (12:25 +0300)
src/ParametersPlugin/ParametersPlugin_WidgetCreator.cpp
src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp
src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.h

index a144ce7398608a6f05ee0c041363510335f94337..1efc0d9e0640167d47d7715f758e20cfce3583c8 100644 (file)
@@ -38,11 +38,11 @@ ModuleBase_ModelWidget*
   ParametersPlugin_WidgetCreator::createWidgetByType(const std::string& theType,
                                                      QWidget* theParent,
                                                      Config_WidgetAPI* theWidgetApi,
-                                                     ModuleBase_IWorkshop* /*theWorkshop*/)
+                                                     ModuleBase_IWorkshop* theWorkshop)
 {
   ModuleBase_ModelWidget* aModelWidget = 0;
   if (theType == "parameters-manager") {
-    aModelWidget = new ParametersPlugin_WidgetParamsMgr(theParent, theWidgetApi);
+    aModelWidget = new ParametersPlugin_WidgetParamsMgr(theParent, theWidgetApi, theWorkshop);
   }
   return aModelWidget;
 }
index 9938df1e66b911170eae3108086274f1a72ea186..9599697852a0cb1c011d8aec28fc0094e1d6114a 100644 (file)
@@ -37,6 +37,8 @@
 #include <GeomDataAPI_Point2D.h>
 
 #include <ModuleBase_Tools.h>
+#include <ModuleBase_IWorkshop.h>
+#include <ModuleBase_IViewer.h>
 
 #include <Events_Loop.h>
 #include <Config_PropManager.h>
@@ -178,9 +180,9 @@ void ParametersPlugin_TreeWidget::closeEditor(QWidget* theEditor,
 /////////////////////////////////////////////////////////////////////////////////////////////////
 
 ParametersPlugin_WidgetParamsMgr::ParametersPlugin_WidgetParamsMgr(QWidget* theParent,
-  const Config_WidgetAPI* theData)
+  const Config_WidgetAPI* theData, ModuleBase_IWorkshop* theWorkshop)
   : ModuleBase_ModelDialogWidget(theParent, theData),
-  isUpplyBlocked(false)
+  myWorkshop(theWorkshop), isUpplyBlocked(false)
 {
   QVBoxLayout* aLayout = new QVBoxLayout(this);
 
@@ -857,4 +859,5 @@ void ParametersPlugin_WidgetParamsMgr::onShowPreview()
   SessionPtr aMgr = ModelAPI_Session::get();
   aMgr->blockAutoUpdate(false);
   aMgr->blockAutoUpdate(true);
-}
\ No newline at end of file
+  myWorkshop->viewer()->update();
+}
index 444cd0cfbb5317ebe83a09043f91e7b9cabd0586..b7042d10c2a4f5001b18fde65735909efaa09ff1 100644 (file)
@@ -29,7 +29,7 @@ class QTreeWidgetItem;
 class ParametersPlugin_ItemDelegate;
 class QPushButton;
 class QToolButton;
-
+class ModuleBase_IWorkshop;
 
 /*!
  * \ingroup GUI
@@ -61,7 +61,8 @@ class ParametersPlugin_WidgetParamsMgr : public ModuleBase_ModelDialogWidget
  Q_OBJECT
 public:
   /// Constructs a model widget
-  ParametersPlugin_WidgetParamsMgr(QWidget* theParent, const Config_WidgetAPI* theData);
+  ParametersPlugin_WidgetParamsMgr(QWidget* theParent, const Config_WidgetAPI* theData,
+    ModuleBase_IWorkshop* theWorkshop);
 
   /// Destructs the model widget
   virtual ~ParametersPlugin_WidgetParamsMgr() {}
@@ -158,6 +159,8 @@ private:
 
   void updateParametersFeatures();
 
+  ModuleBase_IWorkshop* myWorkshop;
+
   ParametersPlugin_TreeWidget* myTable;
   QTreeWidgetItem* myFeatures;
   QTreeWidgetItem* myParameters;