Salome HOME
#1109 Sketch entities preview red lines stayed in the viewer after Sketch is applyed.
[modules/shaper.git] / src / ModuleBase / ModuleBase_PagedContainer.cpp
index d067e100c6132365785787373c2bdb665079a8c7..38b145bfc2f302d504fe629feaf3a2043456fe42 100644 (file)
@@ -13,7 +13,7 @@
 #include <ModelAPI_AttributeString.h>
 
 #include <QWidget>
-#include <Qlist>
+#include <QList>
 #include <QVBoxLayout>
 
 
@@ -29,10 +29,15 @@ ModuleBase_PagedContainer::~ModuleBase_PagedContainer()
 }
 
 int ModuleBase_PagedContainer::addPage(ModuleBase_PageBase* thePage,
-                                      const QString& theName, const QString& theCaseId)
+                                      const QString& theName, const QString& theCaseId,
+                                      const QPixmap& theIcon )
 {
+  if (!myPages.count()) {
+    setDefaultValue(theCaseId.toStdString());
+  }
   myCaseIds << theCaseId;
   myPages << thePage;
+
   return myPages.count();
 }
 
@@ -65,7 +70,7 @@ void ModuleBase_PagedContainer::enableFocusProcessing()
   myIsFocusOnCurrentPage = true;
 }
 
-bool ModuleBase_PagedContainer::restoreValue()
+bool ModuleBase_PagedContainer::restoreValueCustom()
 {
   // A rare case when plugin was not loaded.
   if(!myFeature)
@@ -95,6 +100,7 @@ bool ModuleBase_PagedContainer::storeValueCustom() const
   AttributeStringPtr aStringAttr = aData->string(attributeID());
   QString aWidgetValue = myCaseIds.at(currentPageIndex());
   aStringAttr->setValue(aWidgetValue.toStdString());
+  updateObject(myFeature); // for preview
   return true;
 }