summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-06-02 14:51:04 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-06-02 14:51:04 (GMT)
commitbe833a4f25a8ec8c3dd7a8ac4fa4b0507c93e7ee (patch)
tree6809308ab3cc8031ebc413f29bd7d65ef64545a5
parente40d3cedcf29b89998ffc81f959b2b8523989394 (diff)
downloadQt-be833a4f25a8ec8c3dd7a8ac4fa4b0507c93e7ee.zip
Qt-be833a4f25a8ec8c3dd7a8ac4fa4b0507c93e7ee.tar.gz
Qt-be833a4f25a8ec8c3dd7a8ac4fa4b0507c93e7ee.tar.bz2
Revert "Avoid a crash when setting a focus in a widget hierarchy containing"
This reverts commit a5b11b9031f9a2a97b65e9a6134244249845491a. The proper fix is 1a7da7096bbda17197738061902f4489af234bc0.
-rw-r--r--src/gui/kernel/qwidget.cpp5
1 files 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