]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/ModuleBase/ModuleBase_WidgetValidated.cpp
Salome HOME
Preselection realization for multi-selector widget to accept some selection values.
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetValidated.cpp
index caadc6be7582cc17eb8121963161c657c171b058..a5ec4c5fe52498c83bc6d50eaaa8624c6e0d7c9a 100644 (file)
@@ -29,12 +29,17 @@ ModuleBase_WidgetValidated::~ModuleBase_WidgetValidated()
 }
 
 //********************************************************************
-bool ModuleBase_WidgetValidated::setSelection(ModuleBase_ViewerPrs theValue)
+bool ModuleBase_WidgetValidated::setSelection(const QList<ModuleBase_ViewerPrs>& theValues, int& thePosition)
 {
+  if (thePosition < 0 || thePosition >= theValues.size())
+    return false;
+  ModuleBase_ViewerPrs aValue = theValues[thePosition];
+  thePosition++;
+
   bool isDone = false;
 
-  if (isValidSelection(theValue)) {
-    isDone = setSelectionCustom(theValue);
+  if (isValidSelection(aValue)) {
+    isDone = setSelectionCustom(aValue);
     updateObject(myFeature);
     emit valuesChanged();
   }