From 894983bea2314c2251a10b0924259a6a58c996ef Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Fri, 8 Nov 2013 22:50:44 +0100 Subject: Use qt_mac_effectiveview_for for setFocus_sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently setFocus_sys use qt_mac_nativeview_for to set the focus which triggers a bug rerouting the key events through NSMenu rather that directly to the correct widget. Get the effective id returns the correct widget. This changeset applies the patch proposed in the bug report Task-number: QTBUG-34371 Change-Id: I0831f41ca409ff309954bb45a50975dd4eb1406a Reviewed-by: Morten Johan Sørvig --- src/gui/kernel/qwidget_mac.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index e99dabff93..9985430748 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -3916,7 +3916,7 @@ void QWidgetPrivate::setFocus_sys() if (q->testAttribute(Qt::WA_WState_Created)) { #ifdef QT_MAC_USE_COCOA QMacCocoaAutoReleasePool pool; - NSView *view = qt_mac_nativeview_for(q); + NSView *view = qt_mac_effectiveview_for(q); [[view window] makeFirstResponder:view]; #else SetKeyboardFocus(qt_mac_window_for(q), qt_mac_nativeview_for(q), 1); -- cgit v1.2.3