From: nds Date: Tue, 6 Oct 2015 10:14:17 +0000 (+0300) Subject: Apply widget value change by enter/tab event. X-Git-Tag: V_1.4.0_demo2~22 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1105bfe31c0304ffacd85363d070322049d564f1;p=modules%2Fshaper.git Apply widget value change by enter/tab event. --- diff --git a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp index 47799fc54..8cf2d67cc 100644 --- a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp +++ b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp @@ -85,7 +85,9 @@ ModuleBase_WidgetDoubleValue::ModuleBase_WidgetDoubleValue(QWidget* theParent, mySpinBox->setToolTip(aTTip); aControlLay->addRow(myLabel, mySpinBox); - connect(mySpinBox, SIGNAL(valueChanged(const QString&)), this, SIGNAL(valuesChanged())); + // Apply widget value change by enter/tab event. + //connect(mySpinBox, SIGNAL(valueChanged(const QString&)), this, SIGNAL(valuesChanged())); + connect(mySpinBox, SIGNAL(editingFinished()), this, SIGNAL(valuesChanged())); } ModuleBase_WidgetDoubleValue::~ModuleBase_WidgetDoubleValue() diff --git a/src/ModuleBase/ModuleBase_WidgetIntValue.cpp b/src/ModuleBase/ModuleBase_WidgetIntValue.cpp index 6778b372c..622600ee2 100644 --- a/src/ModuleBase/ModuleBase_WidgetIntValue.cpp +++ b/src/ModuleBase/ModuleBase_WidgetIntValue.cpp @@ -84,7 +84,9 @@ ModuleBase_WidgetIntValue::ModuleBase_WidgetIntValue(QWidget* theParent, mySpinBox->setToolTip(aTTip); aControlLay->addRow(myLabel, mySpinBox); - connect(mySpinBox, SIGNAL(valueChanged(int)), this, SIGNAL(valuesChanged())); + // Apply widget value change by enter/tab event. + //connect(mySpinBox, SIGNAL(valueChanged(int)), this, SIGNAL(valuesChanged())); + connect(mySpinBox, SIGNAL(editingFinished()), this, SIGNAL(valuesChanged())); } ModuleBase_WidgetIntValue::~ModuleBase_WidgetIntValue() diff --git a/src/PartSet/PartSet_WidgetPoint2d.cpp b/src/PartSet/PartSet_WidgetPoint2d.cpp index d94afa5a0..3e25988eb 100644 --- a/src/PartSet/PartSet_WidgetPoint2d.cpp +++ b/src/PartSet/PartSet_WidgetPoint2d.cpp @@ -88,7 +88,9 @@ PartSet_WidgetPoint2D::PartSet_WidgetPoint2D(QWidget* theParent, myXSpin->setToolTip(tr("X")); aGroupLay->addWidget(myXSpin, 0, 1); - connect(myXSpin, SIGNAL(valueChanged(const QString&)), this, SLOT(onValuesChanged())); + // Apply widget value change by enter/tab event. + //connect(myXSpin, SIGNAL(valueChanged(const QString&)), this, SLOT(onValuesChanged())); + connect(myXSpin, SIGNAL(editingFinished()), this, SLOT(onValuesChanged())); } { QLabel* aLabel = new QLabel(myGroupBox); @@ -101,7 +103,9 @@ PartSet_WidgetPoint2D::PartSet_WidgetPoint2D(QWidget* theParent, myYSpin->setToolTip(tr("Y")); aGroupLay->addWidget(myYSpin, 1, 1); - connect(myYSpin, SIGNAL(valueChanged(const QString&)), this, SLOT(onValuesChanged())); + // Apply widget value change by enter/tab event. + //connect(myYSpin, SIGNAL(valueChanged(const QString&)), this, SLOT(onValuesChanged())); + connect(myYSpin, SIGNAL(editingFinished()), this, SLOT(onValuesChanged())); } QVBoxLayout* aLayout = new QVBoxLayout(this); ModuleBase_Tools::zeroMargins(aLayout); diff --git a/src/PartSet/PartSet_WidgetPoint2dDistance.cpp b/src/PartSet/PartSet_WidgetPoint2dDistance.cpp index ee59d8aee..297727d4e 100644 --- a/src/PartSet/PartSet_WidgetPoint2dDistance.cpp +++ b/src/PartSet/PartSet_WidgetPoint2dDistance.cpp @@ -34,8 +34,11 @@ PartSet_WidgetPoint2dDistance::PartSet_WidgetPoint2dDistance(QWidget* theParent, myFirstPntName = theData->getProperty("first_point"); // Reconnect to local slot - disconnect(mySpinBox, SIGNAL(valueChanged(double)), this, SIGNAL(valuesChanged())); - connect(mySpinBox, SIGNAL(valueChanged(double)), this, SLOT(onValuesChanged())); + // Apply widget value change by enter/tab event. + //disconnect(mySpinBox, SIGNAL(valueChanged(double)), this, SIGNAL(valuesChanged())); + //connect(mySpinBox, SIGNAL(valueChanged(double)), this, SLOT(onValuesChanged())); + disconnect(mySpinBox, SIGNAL(editingFinished()), this, SIGNAL(valuesChanged())); + connect(mySpinBox, SIGNAL(editingFinished()), this, SLOT(onValuesChanged())); } PartSet_WidgetPoint2dDistance::~PartSet_WidgetPoint2dDistance()