QApplication: use focus abstraction instead of QWidget::focus_next/prev

Focus abstraction in QWidgetPrivate makes direct access to
QWidget::focus_next and focus_prev an antipattern.

Remove usage.

Task-number: QTBUG-121478
Change-Id: Iaab97024c20b97a0d9850dce43816a432d4bc7a1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
bb10
Axel Spoerl 2024-03-08 17:15:03 +01:00
parent e7ddd490cf
commit 268fa11eef
1 changed files with 2 additions and 2 deletions

View File

@ -1969,7 +1969,7 @@ QWidget *QApplicationPrivate::focusNextPrevChild_helper(QWidget *toplevel, bool
f = toplevel;
QWidget *w = f;
QWidget *test = f->d_func()->focus_next;
QWidget *test = f->nextInFocusChain();
bool seenWindow = false;
bool focusWidgetAfterWindow = false;
while (test && test != f) {
@ -2000,7 +2000,7 @@ QWidget *QApplicationPrivate::focusNextPrevChild_helper(QWidget *toplevel, bool
if (next)
break;
}
test = test->d_func()->focus_next;
test = test->nextInFocusChain();
}
if (wrappingOccurred != nullptr)