From 420b4dbece04f8015cad24a49622c65c540f0a22 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Sat, 5 Dec 2015 13:23:26 +0100 Subject: 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 --- src/gui/kernel/qinputmethod.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/gui/kernel/qinputmethod.cpp') 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 { -- cgit v1.2.3