version check fixed
This commit is contained in:
parent
7c1d8cfa05
commit
71a791918a
@ -31,8 +31,11 @@ static void qskSetFocus( QQuickItem* item, bool on )
|
|||||||
|
|
||||||
if ( const auto scope = qskNearestFocusScope( item ) )
|
if ( const auto scope = qskNearestFocusScope( item ) )
|
||||||
{
|
{
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK( 6, 1, 0 )
|
||||||
|
auto dw = QQuickItemPrivate::get( item )->deliveryAgentPrivate();
|
||||||
|
#else
|
||||||
auto dw = QQuickWindowPrivate::get( item->window() );
|
auto dw = QQuickWindowPrivate::get( item->window() );
|
||||||
|
#endif
|
||||||
if ( on )
|
if ( on )
|
||||||
{
|
{
|
||||||
dw->setFocusInScope( scope, item, Qt::PopupFocusReason );
|
dw->setFocusInScope( scope, item, Qt::PopupFocusReason );
|
||||||
|
@ -238,8 +238,12 @@ void qskForceActiveFocus( QQuickItem* item, Qt::FocusReason reason )
|
|||||||
if ( item == nullptr || item->window() == nullptr )
|
if ( item == nullptr || item->window() == nullptr )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto wp = QQuickWindowPrivate::get( item->window() );
|
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK( 6, 1, 0 )
|
||||||
|
auto wp = QQuickItemPrivate::get( item )->deliveryAgentPrivate();
|
||||||
|
#else
|
||||||
|
auto wp = QQuickWindowPrivate::get( item->window() );
|
||||||
|
#endif
|
||||||
while ( const auto scope = qskNearestFocusScope( item ) )
|
while ( const auto scope = qskNearestFocusScope( item ) )
|
||||||
{
|
{
|
||||||
wp->setFocusInScope( scope, item, reason );
|
wp->setFocusInScope( scope, item, reason );
|
||||||
|
@ -733,7 +733,11 @@ void QskQuickItem::itemChange( QQuickItem::ItemChange change,
|
|||||||
oldWindow->activeFocusItem().
|
oldWindow->activeFocusItem().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK( 6, 1, 0 )
|
||||||
|
auto wd = QQuickWindowPrivate::get( oldWindow )->deliveryAgentPrivate();
|
||||||
|
#else
|
||||||
auto wd = QQuickWindowPrivate::get( oldWindow );
|
auto wd = QQuickWindowPrivate::get( oldWindow );
|
||||||
|
#endif
|
||||||
if ( auto scope = qskNearestFocusScope( this ) )
|
if ( auto scope = qskNearestFocusScope( this ) )
|
||||||
{
|
{
|
||||||
wd->clearFocusInScope( scope, this, Qt::OtherFocusReason );
|
wd->clearFocusInScope( scope, this, Qt::OtherFocusReason );
|
||||||
|
@ -162,7 +162,12 @@ void QskScrollBox::onFocusItemChanged()
|
|||||||
{
|
{
|
||||||
if ( window() )
|
if ( window() )
|
||||||
{
|
{
|
||||||
auto reason = QQuickWindowPrivate::get( window() )->lastFocusReason;
|
#if QT_VERSION >= QT_VERSION_CHECK( 6, 1, 0 )
|
||||||
|
auto wd = QQuickWindowPrivate::get( window() )->deliveryAgentPrivate();
|
||||||
|
#else
|
||||||
|
auto wd = QQuickWindowPrivate::get( window() );
|
||||||
|
#endif
|
||||||
|
auto reason = wd->lastFocusReason;
|
||||||
if ( reason == Qt::TabFocusReason || reason == Qt::BacktabFocusReason )
|
if ( reason == Qt::TabFocusReason || reason == Qt::BacktabFocusReason )
|
||||||
ensureFocusItemVisible();
|
ensureFocusItemVisible();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user