summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-06-02 16:29:57 +0200
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-06-02 16:34:02 +0200
commita5b11b9031f9a2a97b65e9a6134244249845491a (patch)
tree3e25abd2e7738d31a47ad2283c003f3109af9da5 /src/gui
parentad46e77420449ede2cb6c1ea2a810a2614520db9 (diff)
Avoid a crash when setting a focus in a widget hierarchy containing
both visible and invisible widgets. This is a quick hack to avoid a crash in Qt when setting a focus on a visible widget that has invisible parent. Proper fix was committed into master 1a7da7096bbda17197738061902f4489af234bc0, see it's description for more details. Task-number: 254563 Reviewed-by: Thierry Bastian
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qwidget.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index bbf675858c..baf32782d7 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -5804,8 +5804,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