QQuickWindowPrivate: implement clearFocusObject
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>
Wed, 30 Oct 2013 12:19:42 +0000 (13:19 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 1 Nov 2013 16:53:07 +0000 (17:53 +0100)
commitf82e2df554f3d66f88e0b6c8c02b1efe894248cb
tree4808663fdc95610332771ef285aa495498c90760
parent51a2943c018cc435cd840b7f8b6f3b1bff3c96e8
QQuickWindowPrivate: implement clearFocusObject

Ref change: cfa85c7 (qtbase)

Implement QQuickWindowPrivate::clearFocus()
to enable platform plugins to remove focus from the
focus object when the virtual keyboard closes.

On mobile platforms line edits etc are not supposed to
be drawn with focus and blinking cursors unless the
virtual keyboard (or another keyboard) is open. With the
new virtual QWindowPrivate::clearFocus() the
platforms can remove focus without deactivating the
whole window.

The old implementation on iOS deactivated the whole window
when the keyboard was closed. But this was unfortunate,
especially in QtQuick, since a qquicktextinput would
not get active focus unless the window was active. But
the platform would not activate the window unless the
keybaord was open. So, a classic chicken - egg problem.

Change-Id: I62e652a3cd85f1313713c5d086d9537cc2f9826f
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
src/quick/items/qquickwindow.cpp
src/quick/items/qquickwindow_p.h