From: stv Date: Thu, 9 Jun 2005 08:27:59 +0000 (+0000) Subject: Bug fix: Child windows can't recieve keyboard input focus. QtxWorkstackArea::customEv... X-Git-Tag: T3_0_0_a3~30 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f8ccef34f988ea116b5ec0f8aa6913d4e22c77dd;p=modules%2Fgui.git Bug fix: Child windows can't recieve keyboard input focus. QtxWorkstackArea::customEvent() modified. --- diff --git a/src/Qtx/QtxWorkstack.cxx b/src/Qtx/QtxWorkstack.cxx index 9ff6351e0..492044ab6 100644 --- a/src/Qtx/QtxWorkstack.cxx +++ b/src/Qtx/QtxWorkstack.cxx @@ -704,7 +704,7 @@ bool QtxWorkstackArea::eventFilter( QObject* o, QEvent* e ) wid = wid->parentWidget(); } if ( ok ) - QApplication::postEvent( this, new QCustomEvent( (QEvent::Type)( e->type() == QEvent::FocusIn ? ActivateEvent : FocusEvent ) ) ); + QApplication::postEvent( this, new QCustomEvent( (QEvent::Type)( e->type() == QEvent::FocusIn ? ActivateWidget : FocusWidget ) ) ); } } return false; @@ -737,14 +737,14 @@ void QtxWorkstackArea::customEvent( QCustomEvent* e ) { switch ( e->type() ) { - case ActivateEvent: + case ActivateWidget: emit activated( activeWidget() ); break; - case FocusEvent: - if ( activeWidget() ) + case FocusWidget: + if ( activeWidget() && !activeWidget()->focusWidget() ) activeWidget()->setFocus(); break; - case RemoveEvent: + case RemoveWidget: removeWidget( (QWidget*)e->data() ); break; } @@ -801,7 +801,7 @@ void QtxWorkstackArea::onChildDestroyed( QObject* obj ) myChild.remove( wid ); - QApplication::postEvent( this, new QCustomEvent( (QEvent::Type)RemoveEvent, wid ) ); + QApplication::postEvent( this, new QCustomEvent( (QEvent::Type)RemoveWidget, wid ) ); } void QtxWorkstackArea::onChildShown( QtxWorkstackChild* c ) diff --git a/src/Qtx/QtxWorkstack.h b/src/Qtx/QtxWorkstack.h index fa9c4584a..e86ac1ab7 100644 --- a/src/Qtx/QtxWorkstack.h +++ b/src/Qtx/QtxWorkstack.h @@ -148,7 +148,7 @@ protected: virtual void mousePressEvent( QMouseEvent* ); private: - enum { ActivateEvent = QEvent::User, FocusEvent, RemoveEvent }; + enum { ActivateWidget = QEvent::User, FocusWidget, RemoveWidget }; private: void updateState();