diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-06-02 14:50:43 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-06-02 14:50:43 (GMT) |
commit | e40d3cedcf29b89998ffc81f959b2b8523989394 (patch) | |
tree | 9c22c14049d67a9c4dc65675bb732366edb0af28 /src/gui/kernel | |
parent | 1a7da7096bbda17197738061902f4489af234bc0 (diff) | |
parent | a5b11b9031f9a2a97b65e9a6134244249845491a (diff) | |
download | Qt-e40d3cedcf29b89998ffc81f959b2b8523989394.zip Qt-e40d3cedcf29b89998ffc81f959b2b8523989394.tar.gz Qt-e40d3cedcf29b89998ffc81f959b2b8523989394.tar.bz2 |
Merge branch '4.5'
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 5 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_mac.mm | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index d436ffb..451686f 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -5757,8 +5757,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 diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 8243f32..f389bfd 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -1304,8 +1304,11 @@ OSStatus QWidgetPrivate::qt_widget_event(EventHandlerCallRef er, EventRef event, if(part == kControlFocusNoPart){ if (widget->hasFocus()) QApplicationPrivate::setFocusWidget(0, Qt::OtherFocusReason); - } else + } else if (widget->focusPolicy() != Qt::NoFocus) { widget->setFocus(); + } else { + handled_event = false; + } } if(!HIObjectIsOfClass((HIObjectRef)hiview, kObjectQWidget)) CallNextEventHandler(er, event); |