find a default focus item, when a focusScope/tabFence control ( usually

a popup ) gets the focus - to be on the internal tab chain.
This commit is contained in:
Uwe Rathmann 2018-01-19 10:08:59 +01:00
parent 3837205847
commit 19c0e43e5c

View File

@ -1049,6 +1049,23 @@ bool QskControl::event( QEvent* event )
break;
}
case QEvent::FocusIn:
{
if ( isFocusScope() && isTabFence() && ( scopedFocusItem() == nullptr ) )
{
/*
When receiving the focus we need to have a focused
item, so that the tab focus chain has a starting point.
*/
if ( auto focusItem = nextItemInFocusChain( true ) )
{
if ( qskIsAncestorOf( this, focusItem ) )
focusItem->setFocus( true );
}
}
break;
}
}
switch( eventType )