path: root/src/gui/kernel/qinputmethod.cpp
diff options
authorOlivier Goffart <>2015-12-05 13:23:26 +0100
committerOlivier Goffart (Woboq GmbH) <>2015-12-07 16:56:25 +0000
commit420b4dbece04f8015cad24a49622c65c540f0a22 (patch)
tree39a5832ef95a2f24a1275e683b492c5f8d5744ac /src/gui/kernel/qinputmethod.cpp
parent7908da98f01c24bd95a9e7a7f938de697a6a02b6 (diff)
Android: Implement QInputMethod::keyboardRectangle
We can use getWindowVisibleDisplayFrame to know the height on the keyboard, and we can use getLocationOnScreen to find out how much the view is scrolled. Since onPreDraw is always called when the view is scrolled or when the keyboard appears or disapear, we can call the native functions from there. This is not working for floating keyboards. [ChangeLog][Android] Implemented QInputMethod::keyboardRectangle Task-number: QTBUG-40731 Change-Id: I7848eb34fece410b29a06bf0bbb2313112fffa68 Reviewed-by: Samuel Nevala <> Reviewed-by: BogDan Vatra <>
Diffstat (limited to 'src/gui/kernel/qinputmethod.cpp')
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/kernel/qinputmethod.cpp b/src/gui/kernel/qinputmethod.cpp
index 8d51be853a..2684c43518 100644
--- a/src/gui/kernel/qinputmethod.cpp
+++ b/src/gui/kernel/qinputmethod.cpp
@@ -147,6 +147,9 @@ QRectF QInputMethod::cursorRectangle() const
\property QInputMethod::keyboardRectangle
\brief Virtual keyboard's geometry in window coordinates.
+ This might be an empty rectangle if it is not possible to know the geometry
+ of the keyboard. This is the case for a floating keyboard on android.
QRectF QInputMethod::keyboardRectangle() const