Salome HOME
Union of validator and filter functionalities.
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetEditor.cpp
index 7f77acd5a97ac1064fdfd533699a7e85dd71b4ad..8c3b74bdfd4f372db20791bea0838dd6aefc0502 100644 (file)
@@ -47,6 +47,7 @@ double editedValue(double theValue, bool& isDone)
   ModuleBase_Tools::zeroMargins(aLay);
 
   QLineEdit* aEditor = new QLineEdit(QString::number(theValue), &aDlg);
+  aEditor->selectAll();
   aEditor->setValidator(new QDoubleValidator(aEditor));
   QObject::connect(aEditor, SIGNAL(returnPressed()), &aDlg, SLOT(accept()));
   aLay->addWidget(aEditor);
@@ -78,9 +79,7 @@ void ModuleBase_WidgetEditor::showPopupEditor()
   aValue = editedValue(aValue, isDone);
 
   if (isDone) {
-    bool isBlocked = mySpinBox->blockSignals(true);
-    mySpinBox->setValue(aValue);
-    mySpinBox->blockSignals(isBlocked);
+    ModuleBase_Tools::setSpinValue(mySpinBox, aValue);
   }
   emit valuesChanged();
   emit focusOutWidget(this);