]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Updating property pannel on sketch editing (refs #31)
authorsbh <sergey.belash@opencascade.com>
Mon, 5 May 2014 15:09:32 +0000 (19:09 +0400)
committersbh <sergey.belash@opencascade.com>
Mon, 5 May 2014 15:09:32 +0000 (19:09 +0400)
17 files changed:
src/Model/Model_Events.h
src/ModuleBase/CMakeLists.txt
src/ModuleBase/ModuleBase_IModelWidget.h [deleted file]
src/ModuleBase/ModuleBase_MetaWidget.cpp
src/ModuleBase/ModuleBase_MetaWidget.h
src/ModuleBase/ModuleBase_ModelWidget.h [new file with mode: 0644]
src/ModuleBase/ModuleBase_Operation.cpp
src/ModuleBase/ModuleBase_WidgetCustom.h [deleted file]
src/ModuleBase/ModuleBase_WidgetFactory.cpp
src/ModuleBase/ModuleBase_WidgetFactory.h
src/ModuleBase/ModuleBase_WidgetPoint2D.cpp
src/ModuleBase/ModuleBase_WidgetPoint2D.h
src/XGUI/XGUI_OperationMgr.cpp
src/XGUI/XGUI_OperationMgr.h
src/XGUI/XGUI_PropertyPanel.cpp
src/XGUI/XGUI_PropertyPanel.h
src/XGUI/XGUI_Workshop.cpp

index 5c526db97374d6e0b4270152383dee33dc0e06a0..ba0b7ea3438c66a73be4c744e5f719aab1739375 100644 (file)
 class ModelAPI_Feature;
 class ModelAPI_Document;
 
-/// Event ID that feature is created (comes with ModelAPI_FeatureUpdatedMessage)
+/// Event ID that feature is created (comes with Model_FeatureUpdatedMessage)
 static const char * EVENT_FEATURE_CREATED = "FeatureCreated";
-/// Event ID that data of feature is updated (comes with ModelAPI_FeatureUpdatedMessage)
+/// Event ID that data of feature is updated (comes with Model_FeatureUpdatedMessage)
 static const char * EVENT_FEATURE_UPDATED = "FeatureUpdated";
-/// Event ID that data of feature is deleted (comes with ModelAPI_FeatureDeletedMessage)
+/// Event ID that data of feature is deleted (comes with Model_FeatureDeletedMessage)
 static const char * EVENT_FEATURE_DELETED = "FeatureDeleted";
 
 /// Message that feature was changed (used for Object Browser update)
index 02d8d3ef98cab7181db4ce52486b3805ddea95bb..2e706ecb97b695885fb0c0062393195d865eb21c 100644 (file)
@@ -7,11 +7,10 @@ SET(PROJECT_HEADERS
        ModuleBase_Operation.h
        ModuleBase_OperationDescription.h       
        ModuleBase_PropPanelOperation.h
-       ModuleBase_WidgetCustom.h
+       ModuleBase_ModelWidget.h
        ModuleBase_WidgetFactory.h
        ModuleBase_WidgetPoint2D.h
        ModuleBase_WidgetSwitch.h
-       ModuleBase_IModelWidget.h
        ModuleBase_MetaWidget.h
 )
 
diff --git a/src/ModuleBase/ModuleBase_IModelWidget.h b/src/ModuleBase/ModuleBase_IModelWidget.h
deleted file mode 100644 (file)
index e128dc6..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * ModuleBase_IModelWidget.h
- *
- *  Created on: Apr 30, 2014
- *      Author: sbh
- */
-
-#ifndef MODULEBASE_IMODELWIDGET_H_
-#define MODULEBASE_IMODELWIDGET_H_
-
-#include <ModuleBase.h>
-#include <QWidget>
-#include <QString>
-
-/*
- * Common interface for widgets in the property panel.
- * Every widget are able to save/restore data from the
- * model and/or to contain other widgets.
- *
- * Also, there are some methods to simplify and accelerate
- * searching of children.
- */
-class ModuleBase_IModelWidget
-{
-public:
-  //! Interface for saving widget's data into the data model
-  MODULEBASE_EXPORT virtual bool storeValue() = 0;
-  //! Interface for loading widget's data from the data model
-  MODULEBASE_EXPORT virtual bool restoreValue() = 0;
-};
-
-#endif /* MODULEBASE_IMODELWIDGET_H_ */
index 442be7daedaacb6b386f18233897fad96e1487d2..308cc3065fa743b363d6469f3d6821baae8ee150 100644 (file)
@@ -9,10 +9,9 @@
 #include <iostream>
 #endif
 
-ModuleBase_MetaWidget::ModuleBase_MetaWidget(const QString& theId,
-                                               QWidget* theWrapped,
-                                               boost::shared_ptr<ModelAPI_Feature> theFeature)
-    : myId(theId), myWrappedWidget(theWrapped), myFeature(theFeature)
+ModuleBase_MetaWidget::ModuleBase_MetaWidget(QWidget* theWrapped)
+    : ModuleBase_ModelWidget(theWrapped->parent()),
+      myWrappedWidget(theWrapped)
 {
 
 }
@@ -22,7 +21,7 @@ ModuleBase_MetaWidget::~ModuleBase_MetaWidget()
 
 }
 
-bool ModuleBase_MetaWidget::storeValue()
+bool ModuleBase_MetaWidget::storeValue(boost::shared_ptr<ModelAPI_Feature> theFeature)
 {
   #ifdef _DEBUG
   std::cout << "ModuleBase_MetaWidget::storeValue"
@@ -31,7 +30,7 @@ bool ModuleBase_MetaWidget::storeValue()
   return true;
 }
 
-bool ModuleBase_MetaWidget::restoreValue()
+bool ModuleBase_MetaWidget::restoreValue(boost::shared_ptr<ModelAPI_Feature> theFeature)
 {
   #ifdef _DEBUG
   std::cout << "ModuleBase_MetaWidget::restoreValue"
index c81efee13e83533f132fc21708da3048e238006d..2899374c5d4fd33cabcd9151315813775ed9ef9f 100644 (file)
@@ -1,42 +1,34 @@
 /*
- * ModuleBase_IModelWidget.h
  *
- *  Created on: Apr 30, 2014
- *      Author: sbh
  */
 
 #ifndef MODULEBASE_METAWIDGET_H_
 #define MODULEBASE_METAWIDGET_H_
 
-#include <ModuleBase_IModelWidget.h>
 #include <ModuleBase.h>
+#include <ModuleBase_ModelWidget.h>
 
 #include <ModelAPI_Feature.h>
 
 #include <QWidget>
-#include <QString>
 
 #include <boost/shared_ptr.hpp>
 
 /*
  *
  */
-class ModuleBase_MetaWidget : public ModuleBase_IModelWidget
+class ModuleBase_MetaWidget : public ModuleBase_ModelWidget
 {
 public:
-  MODULEBASE_EXPORT ModuleBase_MetaWidget(const QString& theId,
-                                           QWidget* theWrapped,
-                                           boost::shared_ptr<ModelAPI_Feature>);
+  MODULEBASE_EXPORT ModuleBase_MetaWidget(QWidget* theWrapped);
   virtual ~ModuleBase_MetaWidget();
   //! Interface for saving widget's data into the data model
-  MODULEBASE_EXPORT virtual bool storeValue();
+  MODULEBASE_EXPORT virtual bool storeValue(boost::shared_ptr<ModelAPI_Feature> theFeature);
   //! Interface for loading widget's data from the data model
-  MODULEBASE_EXPORT virtual bool restoreValue();
+  MODULEBASE_EXPORT virtual bool restoreValue(boost::shared_ptr<ModelAPI_Feature> theFeature);
 
 private:
-  QString  myId;
   QWidget* myWrappedWidget;
-  boost::shared_ptr<ModelAPI_Feature> myFeature;
 };
 
 #endif /* MODULEBASE_METAWIDGET_H_ */
diff --git a/src/ModuleBase/ModuleBase_ModelWidget.h b/src/ModuleBase/ModuleBase_ModelWidget.h
new file mode 100644 (file)
index 0000000..a684515
--- /dev/null
@@ -0,0 +1,46 @@
+// File:        ModuleBase_ModelWidget.h
+// Created:     25 Apr 2014
+// Author:      Natalia ERMOLAEVA
+
+#ifndef ModuleBase_ModelWidget_H
+#define ModuleBase_ModelWidget_H
+
+#include <ModuleBase.h>
+
+#include <QObject>
+
+#include <boost/shared_ptr.hpp>
+
+class ModelAPI_Feature;
+
+/**\class ModuleBase_ModelWidget
+ * \brief An abstract custom widget class. This class realization is assumed to create some controls.
+ * The controls values modification should send signal about values change.
+ *
+ * Common interface for widgets in the property panel.
+ * Every widget are able to save/restore data from the model and/or to contain other widgets.
+ *
+ */
+class MODULEBASE_EXPORT ModuleBase_ModelWidget : public QObject
+{
+  Q_OBJECT
+public:
+  /// Constructor
+  /// \theParent the parent object
+  ModuleBase_ModelWidget(QObject* theParent) :QObject(theParent) {};
+  /// Destructor
+  virtual ~ModuleBase_ModelWidget() {};
+
+  /// Saves the internal parameters to the given feature
+  /// \param theFeature a model feature to be changed
+  virtual bool storeValue(boost::shared_ptr<ModelAPI_Feature> theFeature) = 0;
+
+  virtual bool restoreValue(boost::shared_ptr<ModelAPI_Feature> theFeature) = 0;
+
+
+signals:
+  /// The signal about widget values changed
+  void valuesChanged();
+};
+
+#endif
index 8c2f4a274f6372e3d2c3739f8e137737b51de1cb..08741337720e7e4dbb5e6efe8e190923b6718c17 100644 (file)
@@ -8,7 +8,7 @@
 #include "ModuleBase_Operation.h"
 
 #include "ModuleBase_OperationDescription.h"
-#include "ModuleBase_WidgetCustom.h"
+#include "ModuleBase_ModelWidget.h"
 
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_Document.h>
@@ -60,9 +60,9 @@ void ModuleBase_Operation::storeCustomValue()
     return;
   }
 
-  ModuleBase_WidgetCustom* aCustom = dynamic_cast<ModuleBase_WidgetCustom*>(sender());
+  ModuleBase_ModelWidget* aCustom = dynamic_cast<ModuleBase_ModelWidget*>(sender());
   if (aCustom)
-    aCustom->store(myFeature);
+    aCustom->storeValue(myFeature);
 }
 
 void ModuleBase_Operation::startOperation()
diff --git a/src/ModuleBase/ModuleBase_WidgetCustom.h b/src/ModuleBase/ModuleBase_WidgetCustom.h
deleted file mode 100644 (file)
index 37716f3..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-// File:        ModuleBase_WidgetCustom.h
-// Created:     25 Apr 2014
-// Author:      Natalia ERMOLAEVA
-
-#ifndef ModuleBase_WidgetCustom_H
-#define ModuleBase_WidgetCustom_H
-
-#include <ModuleBase.h>
-#include <ModuleBase_IModelWidget.h>
-
-#include <QObject>
-
-#include <boost/shared_ptr.hpp>
-
-class ModelAPI_Feature;
-
-/**\class ModuleBase_WidgetCustom
- * \ingroup GUI
- * \brief An abstract custom widget class. This class realization is assumed to create some controls.
- * The controls values modification should send signal about values change. Method store is used to fill
- * the feature with the 
- */
-class MODULEBASE_EXPORT ModuleBase_WidgetCustom : public QObject
-{
-  Q_OBJECT
-public:
-  /// Constructor
-  /// \theParent the parent object
-  ModuleBase_WidgetCustom(QObject* theParent) :QObject(theParent) {};
-  /// Destructor
-  virtual ~ModuleBase_WidgetCustom() {};
-
-  /// Saves the internal parameters to the given feature
-  /// \param theFeature a model feature to be changed
-  virtual void store(boost::shared_ptr<ModelAPI_Feature> theFeature) = 0;
-
-signals:
-  /// The signal about widget values changed
-  void valuesChanged();
-};
-
-#endif
index d89f27de4855c7bf3ef765bd546f33ed05434312..ab27df2df1fcee51d5f11936f38f6c7c89314bca 100644 (file)
@@ -185,17 +185,16 @@ QWidget* ModuleBase_WidgetFactory::doubleSpinBoxControl()
   aControlLay->setStretch(1, 1);
   result->setLayout(aControlLay);
   connectWidget(aBox, WDG_DOUBLEVALUE);
-  ModuleBase_MetaWidget* aWrappedWdg =
-      new ModuleBase_MetaWidget(anObjName, aBox, myOperation->feature());
-  myWidgets.append(aWrappedWdg);
   return result;
 }
 
 QWidget* ModuleBase_WidgetFactory::pointSelectorControl(QWidget* theParent)
 {
   ModuleBase_WidgetPoint2D* aWidget = new ModuleBase_WidgetPoint2D(theParent,
-                       qs(myWidgetApi->getProperty(CONTAINER_PAGE_NAME)), myWidgetApi->widgetId());
+                       qs(myWidgetApi->getProperty(CONTAINER_PAGE_NAME)),
+                       myWidgetApi->widgetId());
   connectWidget(aWidget, WDG_POINT_SELECTOR);
+  myModelWidgets.append(aWidget);
   return aWidget->getControl();
 }
 
@@ -207,8 +206,7 @@ bool ModuleBase_WidgetFactory::connectWidget(QObject* theWidget,  const QString&
                               myOperation, SLOT(storeReal(double)));
   }
   if (theType == WDG_POINT_SELECTOR) {
-    ModuleBase_WidgetCustom* aCustom = dynamic_cast<ModuleBase_WidgetCustom*>(theWidget);
-    result = QObject::connect(aCustom, SIGNAL(valuesChanged()), 
+    result = QObject::connect(theWidget, SIGNAL(valuesChanged()),
                               myOperation, SLOT(storeCustomValue()));
   }
   return result;
index c5b8ef59881f46a86a6d8b541eda092422cf4dd0..bf765824f95dcdbc4a106bd1e4e0ad761f4738f6 100644 (file)
@@ -9,7 +9,7 @@
 #define ModuleBase_WidgetFactory_H_
 
 #include <ModuleBase.h>
-#include <ModuleBase_IModelWidget.h>
+#include <ModuleBase_ModelWidget.h>
 
 #include <QString>
 #include <QList>
@@ -27,9 +27,9 @@ public:
 
   void createWidget(QWidget* theParent);
 
-  QList<ModuleBase_IModelWidget*> getWrappedWidgets() const
+  QList<ModuleBase_ModelWidget*> getModelWidgets() const
   {
-    return myWidgets;
+    return myModelWidgets;
   }
 
 protected:
@@ -47,7 +47,7 @@ private:
   Config_WidgetAPI* myWidgetApi;
   ModuleBase_Operation*   myOperation;
 
-  QList<ModuleBase_IModelWidget*> myWidgets;
+  QList<ModuleBase_ModelWidget*> myModelWidgets;
 };
 
 #endif /* ModuleBase_WidgetFactory_H_ */
index 5ca2eb98d74d8c0075dd023a4c5876257b2c0a3b..35c91813defbf7661819e59ab219276b47e62289 100644 (file)
@@ -20,7 +20,7 @@
 
 ModuleBase_WidgetPoint2D::ModuleBase_WidgetPoint2D(QWidget* theParent, QString theTitle,
                                                    const std::string& theFeatureAttributeID)
-: ModuleBase_WidgetCustom(theParent), myFeatureAttributeID(theFeatureAttributeID)
+: ModuleBase_ModelWidget(theParent), myFeatureAttributeID(theFeatureAttributeID)
 {
   myGroupBox = new QGroupBox(theTitle, theParent);
   QGridLayout* aGroupLay = new QGridLayout(myGroupBox);
@@ -60,13 +60,27 @@ ModuleBase_WidgetPoint2D::~ModuleBase_WidgetPoint2D()
 {
 }
 
-void ModuleBase_WidgetPoint2D::store(boost::shared_ptr<ModelAPI_Feature> theFeature)
+bool ModuleBase_WidgetPoint2D::storeValue(boost::shared_ptr<ModelAPI_Feature> theFeature)
 {
   boost::shared_ptr<ModelAPI_Data> aData = theFeature->data();
   boost::shared_ptr<GeomDataAPI_Point2D> aPoint =
     boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(aData->attribute(myFeatureAttributeID));
 
   aPoint->setValue(myXSpin->value(), myYSpin->value());
+  return true;
+}
+
+bool ModuleBase_WidgetPoint2D::restoreValue(boost::shared_ptr<ModelAPI_Feature> theFeature)
+{
+  boost::shared_ptr<ModelAPI_Data> aData = theFeature->data();
+  boost::shared_ptr<GeomDataAPI_Point2D> aPoint =
+    boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(aData->attribute(myFeatureAttributeID));
+
+  bool isBlocked = this->blockSignals(true);
+  myXSpin->setValue(aPoint->x());
+  myYSpin->setValue(aPoint->y());
+  this->blockSignals(isBlocked);
+  return true;
 }
 
 QWidget* ModuleBase_WidgetPoint2D::getControl() const
index a973ef693bf4951c8d4d8ed21b09f6227ac2f77c..cd52779dc484dcade9ac2454673e436f17c6077c 100644 (file)
@@ -6,7 +6,7 @@
 #define ModuleBase_WidgetPoint2D_H
 
 #include <ModuleBase.h>
-#include "ModuleBase_WidgetCustom.h"
+#include "ModuleBase_ModelWidget.h"
 
 #include <QObject>
 
@@ -19,7 +19,7 @@ class QDoubleSpinBox;
  * \ingroup GUI
  * \brief Custom widget. An abstract class to be redefined to fill with some GUI controls
  */
-class MODULEBASE_EXPORT ModuleBase_WidgetPoint2D : public ModuleBase_WidgetCustom
+class MODULEBASE_EXPORT ModuleBase_WidgetPoint2D : public ModuleBase_ModelWidget
 {
   Q_OBJECT
 public:
@@ -34,7 +34,9 @@ public:
 
   /// Saves the internal parameters to the given feature
   /// \param theFeature a model feature to be changed
-  virtual void store(boost::shared_ptr<ModelAPI_Feature> theFeature);
+  virtual bool storeValue(boost::shared_ptr<ModelAPI_Feature> theFeature);
+
+  virtual bool restoreValue(boost::shared_ptr<ModelAPI_Feature> theFeature);
 
   /// Returns the internal parent wiget control, that can be shown anywhere
   /// \returns the widget
index 0bab9abba1584de538b304c1575b67eccb662d53..4f4caf21c12df41058049b9bed3659568ee3374b 100644 (file)
@@ -22,6 +22,11 @@ ModuleBase_Operation* XGUI_OperationMgr::currentOperation() const
   return myOperations.count() > 0 ? myOperations.last() : 0;
 }
 
+bool XGUI_OperationMgr::hasOperation() const
+{
+  return (myOperations.count() > 0) && (myOperations.last() != NULL);
+}
+
 bool XGUI_OperationMgr::startOperation(ModuleBase_Operation* theOperation)
 {
   if (!canStartOperation(theOperation))
index 2e74ab0b1d045c300b820b0a6259d6e4ba85d443..e3f653cca115b719d6eb138d3d4f00f320915112 100644 (file)
@@ -34,6 +34,8 @@ public:
   /// Returns the current operation or NULL
   /// \return the current operation
   ModuleBase_Operation* currentOperation() const;
+  /// Returns true is operation manager has at least one non-null operation.
+  bool hasOperation() const;
   /// Start the operation and append it to the stack of operations
   /// \param theOperation the started operation
   /// \return the state whether the current operation is started
index 202be90fc640838f981c1e2c15e34171f4a927b7..09a6c727ebe6041d521876455d977f1bb13a0e53 100644 (file)
@@ -61,7 +61,7 @@ XGUI_PropertyPanel::~XGUI_PropertyPanel()
 {
 }
 
-void XGUI_PropertyPanel::setModelWidgets(const QList<ModuleBase_IModelWidget*>& theWidgets)
+void XGUI_PropertyPanel::setModelWidgets(const QList<ModuleBase_ModelWidget*>& theWidgets)
 {
   myWidgets = theWidgets;
 }
@@ -71,9 +71,9 @@ QWidget* XGUI_PropertyPanel::contentWidget()
   return myCustomWidget;
 }
 
-void XGUI_PropertyPanel::updateContentWidget()
+void XGUI_PropertyPanel::updateContentWidget(boost::shared_ptr<ModelAPI_Feature> theFeature)
 {
-  foreach(ModuleBase_IModelWidget* eachWidget, myWidgets) {
-    eachWidget->restoreValue();
+  foreach(ModuleBase_ModelWidget* eachWidget, myWidgets) {
+    eachWidget->restoreValue(theFeature);
   }
 }
index 92de955c1be82289da83263a317104d10e7afb08..9229b8756644a5ccf5336f0d35a57e3121a0edf5 100644 (file)
@@ -8,7 +8,7 @@
 #ifndef XGUI_PROPERTYPANEL_H_
 #define XGUI_PROPERTYPANEL_H_
 
-#include <ModuleBase_IModelWidget.h>
+#include <ModuleBase_ModelWidget.h>
 
 #include <QDockWidget>
 #include <QList>
@@ -21,15 +21,15 @@ public:
   virtual ~XGUI_PropertyPanel();
 
   QWidget* contentWidget();
-  void setModelWidgets(const QList<ModuleBase_IModelWidget*>& theWidgets);
+  void setModelWidgets(const QList<ModuleBase_ModelWidget*>& theWidgets);
 
 public slots:
-  void updateContentWidget();
+  void updateContentWidget(boost::shared_ptr<ModelAPI_Feature> theFeature);
 
 private:
   QWidget* myCustomWidget;
 
-  QList<ModuleBase_IModelWidget*> myWidgets;
+  QList<ModuleBase_ModelWidget*> myWidgets;
 };
 
 #endif /* XGUI_PROPERTYPANEL_H_ */
index c80c8a7aefc0f02908614c0abc7b7857f0f1b5b6..a956d04871e44558890fa789101dde8871002dd2 100644 (file)
@@ -177,17 +177,27 @@ XGUI_Workbench* XGUI_Workshop::addWorkbench(const QString& theName)
 //******************************************************
 void XGUI_Workshop::processEvent(const Events_Message* theMessage)
 {
+  //A message to start feature creation received.
   static Events_ID aFeatureLoadedId = Events_Loop::loop()->eventByName(EVENT_FEATURE_LOADED);
   if (theMessage->eventID() == aFeatureLoadedId) {
     const Config_FeatureMessage* aFeatureMsg = dynamic_cast<const Config_FeatureMessage*>(theMessage);
     addFeature(aFeatureMsg);
     return;
   }
+  //Update property panel on corresponding message. If there is no current operation (no
+  //property panel), or received message has different feature to the current - do nothing.
   static Events_ID aFeatureUpdatedId = Events_Loop::loop()->eventByName(EVENT_FEATURE_UPDATED);
-  if (theMessage->eventID() == aFeatureUpdatedId)
+  if (theMessage->eventID() == aFeatureUpdatedId && myOperationMgr->hasOperation())
   {
-    myPropertyPanel->updateContentWidget();
+    const Model_FeatureUpdatedMessage* anUpdateMsg =
+        dynamic_cast<const Model_FeatureUpdatedMessage*>(theMessage);
+    boost::shared_ptr<ModelAPI_Feature> aNewFeature = anUpdateMsg->feature();
+    boost::shared_ptr<ModelAPI_Feature> aCurrentFeature = myOperationMgr->currentOperation()->feature();
+    if(aNewFeature == aCurrentFeature) {
+      myPropertyPanel->updateContentWidget(aCurrentFeature);
+    }
   }
+  //An operation passed by message. Start it, process and commit.
   const Config_PointerMessage* aPartSetMsg = dynamic_cast<const Config_PointerMessage*>(theMessage);
   if (aPartSetMsg) {
     ModuleBase_Operation* anOperation =
@@ -201,6 +211,7 @@ void XGUI_Workshop::processEvent(const Events_Message* theMessage)
     }
     return;
   }
+  //Show error dialog if error message received.
   const Events_Error* anAppError = dynamic_cast<const Events_Error*>(theMessage);
   if (anAppError) {
     emit errorOccurred(QString::fromLatin1(anAppError->description()));
@@ -222,8 +233,10 @@ void XGUI_Workshop::onOperationStarted()
     showPropertyPanel();
 
     ModuleBase_WidgetFactory aFactory = ModuleBase_WidgetFactory(aOperation);
-    aFactory.createWidget(myPropertyPanel->contentWidget());
-    myPropertyPanel->setModelWidgets(aFactory.getWrappedWidgets());
+    QWidget* aContent = myPropertyPanel->contentWidget();
+    qDeleteAll(aContent->children());
+    aFactory.createWidget(aContent);
+    myPropertyPanel->setModelWidgets(aFactory.getModelWidgets());
     myPropertyPanel->setWindowTitle(aOperation->getDescription()->description());
   }
 }