From be833a4f25a8ec8c3dd7a8ac4fa4b0507c93e7ee Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Tue, 2 Jun 2009 16:51:04 +0200 Subject: Revert "Avoid a crash when setting a focus in a widget hierarchy containing" This reverts commit a5b11b9031f9a2a97b65e9a6134244249845491a. The proper fix is 1a7da7096bbda17197738061902f4489af234bc0. --- src/gui/kernel/qwidget.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 451686f..d436ffb 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -5757,9 +5757,8 @@ void QWidget::setFocus(Qt::FocusReason reason) void QWidget::clearFocus() { QWidget *w = this; - while (w) { - if (w->d_func()->focus_child == this) - w->d_func()->focus_child = 0; + while (w && w->d_func()->focus_child == this) { + w->d_func()->focus_child = 0; w = w->parentWidget(); } #ifndef QT_NO_GRAPHICSVIEW -- cgit v0.12