]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Bug fix: Child windows can't recieve keyboard input focus. QtxWorkstackArea::customEv...
authorstv <stv@opencascade.com>
Thu, 9 Jun 2005 08:27:59 +0000 (08:27 +0000)
committerstv <stv@opencascade.com>
Thu, 9 Jun 2005 08:27:59 +0000 (08:27 +0000)
src/Qtx/QtxWorkstack.cxx
src/Qtx/QtxWorkstack.h

index 9ff6351e0f32f7b8b639d6ed8e7320a5c19ea865..492044ab63358c492707b04c96b37b22c10ab2c6 100644 (file)
@@ -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 )
index fa9c4584afc320aba4672b6e8e6acca0edf1107b..e86ac1ab75ebbcd19ba65a79f66a4c4bba40952f 100644 (file)
@@ -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();