From 28d5a4e73b1d6c82e2568fd19d63554ea22f8710 Mon Sep 17 00:00:00 2001 From: Bhushan Shah Date: Tue, 14 Jul 2020 12:29:57 +0530 Subject: [PATCH] [virtualkeyboard] Fix the qtvirtualkeyboard with Qt 5.15 On 5.15, the VirtualKeyboard did not have a correct z-order which caused the virtualkeyboard to hide as soon as key was pressed, upon investigation it seems that upstream Qt changed behavior in following changes. https://codereview.qt-project.org/c/qt/qtvirtualkeyboard/+/292472 https://codereview.qt-project.org/c/qt/qtvirtualkeyboard/+/292674 Now when desktop-integration is used (i.e non-application embedded mode) one need to set property desktopPanel to true so that it have correct z-ordering and does not miss input events. This is used in Component.onCompleted to avoid breaking it for the Qt 5.14.x qtvirtualkeyboard. When we switch to 5.15 property assignment can be moved to InputPanel declaration. --- qml/virtualkeyboard/main.qml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qml/virtualkeyboard/main.qml b/qml/virtualkeyboard/main.qml index ef1a967f3d..b9ecddc28b 100644 --- a/qml/virtualkeyboard/main.qml +++ b/qml/virtualkeyboard/main.qml @@ -62,4 +62,11 @@ Item { } } } + // this property assignment is done here to not break 5.14.x qtvirtualkeyboard + // TODO: Move it to InputPanel when we depend on 5.15 + Component.onCompleted: { + if (inputPanel.hasOwnProperty("desktopPanel")) { + inputPanel.desktopPanel = true; + } + } }