diff options
Diffstat (limited to 'src/gui/kernel/qwidget.cpp')
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 955ac8b..b376f20 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -5825,8 +5825,9 @@ void QWidget::setFocus(Qt::FocusReason reason) void QWidget::clearFocus() { QWidget *w = this; - while (w && w->d_func()->focus_child == this) { - w->d_func()->focus_child = 0; + while (w) { + if (w->d_func()->focus_child == this) + w->d_func()->focus_child = 0; w = w->parentWidget(); } #ifndef QT_NO_GRAPHICSVIEW |