shifting the focus when removing the active focus item from the focus
tab chain
This commit is contained in:
parent
9bd3e608ba
commit
89cedda359
@ -107,7 +107,20 @@ void QskControl::setFocusPolicy( Qt::FocusPolicy policy )
|
||||
if ( policy != d->focusPolicy )
|
||||
{
|
||||
d->focusPolicy = ( policy & ~Qt::TabFocus );
|
||||
Inherited::setActiveFocusOnTab( policy & Qt::TabFocus );
|
||||
|
||||
const bool tabFocus = policy & Qt::TabFocus;
|
||||
|
||||
if ( !tabFocus && window() )
|
||||
{
|
||||
// Removing the activeFocusItem from the focus tab chain is not possible
|
||||
if ( window()->activeFocusItem() == this )
|
||||
{
|
||||
if ( auto focusItem = nextItemInFocusChain( true ) )
|
||||
focusItem->setFocus( true );
|
||||
}
|
||||
}
|
||||
|
||||
Inherited::setActiveFocusOnTab( tabFocus );
|
||||
|
||||
Q_EMIT focusPolicyChanged();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user