diff --git a/pqSpinBoxEventTranslator.cxx b/pqSpinBoxEventTranslator.cxx index ffee69c8433b4b9cbe90340d3b7ba0befbbbc445..b54f6c2929db327927ec8c8845b56c8ec194f181 100644 --- a/pqSpinBoxEventTranslator.cxx +++ b/pqSpinBoxEventTranslator.cxx @@ -54,17 +54,17 @@ bool pqSpinBoxEventTranslator::translateEvent(QObject* Object, QEvent* Event, bo return true; } - if(!object) + if(!object) return false; if(Event->type() == QEvent::Enter && Object==object) { 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(Event);