Salome HOME
The slot "onTextChanged" is disconnect, but value is updated in method value().
[modules/gui.git] / src / Qtx / QtxWorkstack.cxx
index 9ff6351e0f32f7b8b639d6ed8e7320a5c19ea865..2ca7b819ab1edbfa2565d23a6fb8bd3d62c12508 100644 (file)
@@ -244,9 +244,12 @@ void QtxWorkstack::onDeactivated( QtxWorkstackArea* area )
   if ( idx == -1 )
     return;
 
+  myWin = 0;
+  myArea = 0;
+
   QtxWorkstackArea* newArea = neighbourArea( area );
-  if ( newArea )
-    newArea->setFocus();
+  if ( newArea && newArea->activeWidget() )
+    newArea->activeWidget()->setFocus();
 
   QApplication::postEvent( this, new QCustomEvent( QEvent::User ) );
 }
@@ -704,7 +707,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 +740,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 +804,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 )