diff options
author | Richard Moe Gustavsen <richard.gustavsen@digia.com> | 2013-10-30 09:36:44 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-01 07:30:06 +0100 |
commit | eb64c765e3aa37da1373360c557e23aa29a2db48 (patch) | |
tree | b428339601a6387b754dd6f88e62ddd047b8cdf5 /src | |
parent | cfa85c76c7c7e1622cb02edcbbc3d948edca1e7f (diff) |
iOS: clear focus object when resigning first responder status
Instead of deactivating the window when we resign first
responder status, we now leave it focused, and
tell it to clear its focus object instead.
This will work better with the rest of Qt, which expects
a window to have focus when its in front.
Change-Id: I6fcc232467af306b791a834f4843bfd2786b206f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/ios/qioswindow.mm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm index dbeec5f5f2..74a56b0934 100644 --- a/src/plugins/platforms/ios/qioswindow.mm +++ b/src/plugins/platforms/ios/qioswindow.mm @@ -48,6 +48,7 @@ #include "qiosviewcontroller.h" #include "qiosintegration.h" #include <QtGui/private/qguiapplication_p.h> +#include <QtGui/private/qwindow_p.h> #include <qpa/qplatformintegration.h> #import <QuartzCore/CAEAGLLayer.h> @@ -256,7 +257,10 @@ - (BOOL)resignFirstResponder { - QWindowSystemInterface::handleWindowActivated(0); + // Resigning first responed status means that the virtual keyboard was closed, or + // some other view became first responder. In either case we clear the focus object to + // avoid blinking cursors in line edits etc: + static_cast<QWindowPrivate *>(QObjectPrivate::get(m_qioswindow->window()))->clearFocusObject(); return [super resignFirstResponder]; } |