diff options
author | Alexander Volkov <avolkov@astralinux.ru> | 2021-11-09 18:02:49 +0300 |
---|---|---|
committer | Alexander Volkov <avolkov@astralinux.ru> | 2021-11-19 23:55:44 +0300 |
commit | 185c8d5adf563e19d8a969382663a988a7173614 (patch) | |
tree | be6f0336196668ef2a2769c50c18cc08f4e66614 /src | |
parent | 610123b1c8fa5f8f376b15659cd671936eb79ec5 (diff) |
Skip disabled proxy widgets when (back)tabbing
Fixes: QTBUG-98137
Pick-to: 6.2 5.15
Change-Id: If52053dce361b130ef7dcfaf747710d8ceb9bbcd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index fd3b5f6378..0fa3c6a3d7 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -1955,7 +1955,10 @@ QWidget *QApplicationPrivate::focusNextPrevChild_helper(QWidget *toplevel, bool // \a next). This is to ensure that we can tab in and out of compound widgets // without getting stuck in a tab-loop between parent and child. QWidget *focusProxy = test->d_func()->deepestFocusProxy(); - const bool canTakeFocus = ((focusProxy ? focusProxy->focusPolicy() : test->focusPolicy()) + auto effectiveFocusPolicy = [](QWidget *widget) { + return widget->isEnabled() ? widget->focusPolicy() : Qt::NoFocus; + }; + const bool canTakeFocus = (effectiveFocusPolicy(focusProxy ? focusProxy : test) & focus_flag) == focus_flag; const bool composites = focusProxy ? (next ? focusProxy->isAncestorOf(test) : test->isAncestorOf(focusProxy)) |