summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2018-08-24 22:56:45 +0200
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2018-08-30 04:25:22 +0000
commit81e298a51d08c510457b4a26b37c0d4aac5eba65 (patch)
treed3278e9d2c62b794aff6fe1fd6aadb05c5b05268 /src
parent9a3bdbf40af7e4915ed343c8e9917a0f3f54e0ae (diff)
QWidget: fix setTabOrder for compound widgets
When adjusting the tab order for compound widgets, it can happen that the order is already correct. The check for this case forgot one case which lead to a garbled focus chain. Task-number: QTBUG-68393 Task-number: QTBUG-69619 Task-number: QTBUG-10907 Change-Id: Ic3242746bdcf3a4db6ea8daa1498381500ca116d Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/kernel/qwidget.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 23d8d32b0d..4adccceebb 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -6963,8 +6963,10 @@ void QWidget::setTabOrder(QWidget* first, QWidget *second)
determineLastFocusChild(second, lastFocusChildOfSecond);
// If the tab order is already correct, exit early
- if (lastFocusChildOfFirst->d_func()->focus_next == second)
+ if (lastFocusChildOfFirst == second ||
+ lastFocusChildOfFirst->d_func()->focus_next == second) {
return;
+ }
// Note that we need to handle two different sections in the tab chain; The section
// that 'first' belongs to (firstSection), where we are about to insert 'second', and