path: root/src
diff options
authorRichard Moe Gustavsen <>2013-10-30 09:36:44 +0100
committerThe Qt Project <>2013-11-01 07:30:06 +0100
commiteb64c765e3aa37da1373360c557e23aa29a2db48 (patch)
treeb428339601a6387b754dd6f88e62ddd047b8cdf5 /src
parentcfa85c76c7c7e1622cb02edcbbc3d948edca1e7f (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ø <>
Diffstat (limited to 'src')
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/platforms/ios/ b/src/plugins/platforms/ios/
index dbeec5f5f2..74a56b0934 100644
--- a/src/plugins/platforms/ios/
+++ b/src/plugins/platforms/ios/
@@ -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];