diff --git a/src/controls/QskPopup.cpp b/src/controls/QskPopup.cpp index bc391394..69d1f5de 100644 --- a/src/controls/QskPopup.cpp +++ b/src/controls/QskPopup.cpp @@ -31,8 +31,11 @@ static void qskSetFocus( QQuickItem* item, bool on ) 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() ); - +#endif if ( on ) { dw->setFocusInScope( scope, item, Qt::PopupFocusReason ); diff --git a/src/controls/QskQuick.cpp b/src/controls/QskQuick.cpp index b38266c4..746a4b0d 100644 --- a/src/controls/QskQuick.cpp +++ b/src/controls/QskQuick.cpp @@ -238,8 +238,12 @@ void qskForceActiveFocus( QQuickItem* item, Qt::FocusReason reason ) if ( item == nullptr || item->window() == nullptr ) 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 ) ) { wp->setFocusInScope( scope, item, reason ); diff --git a/src/controls/QskQuickItem.cpp b/src/controls/QskQuickItem.cpp index 5be829f3..5afe7a2f 100644 --- a/src/controls/QskQuickItem.cpp +++ b/src/controls/QskQuickItem.cpp @@ -733,7 +733,11 @@ void QskQuickItem::itemChange( QQuickItem::ItemChange change, oldWindow->activeFocusItem(). */ +#if QT_VERSION >= QT_VERSION_CHECK( 6, 1, 0 ) + auto wd = QQuickWindowPrivate::get( oldWindow )->deliveryAgentPrivate(); +#else auto wd = QQuickWindowPrivate::get( oldWindow ); +#endif if ( auto scope = qskNearestFocusScope( this ) ) { wd->clearFocusInScope( scope, this, Qt::OtherFocusReason ); diff --git a/src/controls/QskScrollBox.cpp b/src/controls/QskScrollBox.cpp index 3f9fceaf..1c3901d2 100644 --- a/src/controls/QskScrollBox.cpp +++ b/src/controls/QskScrollBox.cpp @@ -162,7 +162,12 @@ void QskScrollBox::onFocusItemChanged() { 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 ) ensureFocusItemVisible(); }