diff --git a/src/controls/QskControl.cpp b/src/controls/QskControl.cpp index ab2ae90c..1c65a02c 100644 --- a/src/controls/QskControl.cpp +++ b/src/controls/QskControl.cpp @@ -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 )