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>bb10
parent
cfa85c76c7
commit
eb64c765e3
|
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue