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;
{
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;
}
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 )
virtual void mousePressEvent( QMouseEvent* );
private:
- enum { ActivateEvent = QEvent::User, FocusEvent, RemoveEvent };
+ enum { ActivateWidget = QEvent::User, FocusWidget, RemoveWidget };
private:
void updateState();