Commit cb5fc5cc authored by Benjamin Long's avatar Benjamin Long

Modified Disconnect of QSpinBox:

Most of the time the Spin Box can be modified by other widget.
We only want to record event when we are over this widget.
parent d20436ef
......@@ -61,10 +61,10 @@ bool pqSpinBoxEventTranslator::translateEvent(QObject* Object, QEvent* Event, bo
{
if(this->CurrentObject != Object)
{
if(this->CurrentObject)
{
disconnect(this->CurrentObject, 0, this, 0);
}
// if(this->CurrentObject)
// {
// disconnect(this->CurrentObject, 0, this, 0);
// }
this->CurrentObject = Object;
this->Value = object->value();
connect(object, SIGNAL(valueChanged(int)),this, SLOT(onValueChanged(int)));
......@@ -72,6 +72,12 @@ bool pqSpinBoxEventTranslator::translateEvent(QObject* Object, QEvent* Event, bo
}
}
if (Event->type() == QEvent::Leave && Object==object)
{
disconnect(this->CurrentObject, 0, this, 0);
this->CurrentObject = 0;
}
if(Event->type() == QEvent::KeyRelease && Object == object)
{
QKeyEvent* ke = static_cast<QKeyEvent*>(Event);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment