Salome HOME
Fix of IPAL19633 (Qt4 porting. Strange value of Tolerance when use spin box): set...
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_ExtrusionDlg.cxx
index e1fe9721e5d6b703184a5e5a2369692a8935c714..7f8ac16736db8c7f1ec7862d05e9dc8055659afa 100644 (file)
@@ -148,6 +148,8 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule)
   GroupArgumentsLayout->setSpacing(SPACING);
   GroupArgumentsLayout->setMargin(MARGIN);
 
+  myIdValidator = new SMESHGUI_IdValidator(this);
+
   // Controls for elements selection
   TextLabelElements = new QLabel(tr("SMESH_ID_ELEMENTS"), GroupArguments);
 
@@ -155,7 +157,7 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule)
   SelectElementsButton->setIcon(image2);
 
   LineEditElements = new QLineEdit(GroupArguments);
-  LineEditElements->setValidator(new SMESHGUI_IdValidator(this));
+  LineEditElements->setValidator(myIdValidator);
 
   // Control for the whole mesh selection
   CheckBoxMesh = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments);
@@ -707,6 +709,7 @@ void SMESHGUI_ExtrusionDlg::onSelectMesh (bool toSelectMesh)
       aViewWindow->SetSelectionMode(ActorSelection);
     mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
     LineEditElements->setReadOnly(true);
+    LineEditElements->setValidator(0);
   } else {
     int aConstructorId = GetConstructorId();
     if (aConstructorId == 0)
@@ -721,6 +724,7 @@ void SMESHGUI_ExtrusionDlg::onSelectMesh (bool toSelectMesh)
       }
 
     LineEditElements->setReadOnly(false);
+    LineEditElements->setValidator(myIdValidator);
     onTextChange(LineEditElements->text());
   }