From f8ccef34f988ea116b5ec0f8aa6913d4e22c77dd Mon Sep 17 00:00:00 2001 From: stv Date: Thu, 9 Jun 2005 08:27:59 +0000 Subject: [PATCH] Bug fix: Child windows can't recieve keyboard input focus. QtxWorkstackArea::customEvent() modified. --- src/Qtx/QtxWorkstack.cxx | 12 ++++++------ src/Qtx/QtxWorkstack.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) 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(); -- 2.39.2