aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTarja Sundqvist <tarja.sundqvist@qt.io>2022-11-10 22:42:52 +0200
committerTarja Sundqvist <tarja.sundqvist@qt.io>2022-11-10 22:42:52 +0200
commit5f66c9571303170f07954f73b09cad4cee1ce5d0 (patch)
tree4db1bfeffd318749c777ca1dafe230026b3e15d0
parent8aebadb96c1e57ba89bba2e5962399f676207a32 (diff)
parent7eaab2d3cbcd557385e7656fae287328d6242b37 (diff)
Merge remote-tracking branch 'origin/tqtc/lts-5.15.8' into tqtc/lts-5.15-opensourcev5.15.8-lts-lgpl
-rw-r--r--.qmake.conf2
-rw-r--r--src/virtualkeyboard/content/InputPanel.qml11
-rw-r--r--src/virtualkeyboard/doc/src/deployment-guide.qdoc26
-rw-r--r--src/virtualkeyboard/qvirtualkeyboardinputcontext_p.cpp21
-rw-r--r--src/virtualkeyboard/qvirtualkeyboardinputcontext_p.h2
-rw-r--r--tests/auto/inputpanel/BLACKLIST22
6 files changed, 71 insertions, 13 deletions
diff --git a/.qmake.conf b/.qmake.conf
index 6d03a03f..48f4c9ef 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -2,4 +2,4 @@ load(qt_build_config)
DEFINES += QT_NO_FOREACH QT_NO_JAVA_STYLE_ITERATORS QT_NO_LINKED_LIST
-MODULE_VERSION = 5.15.7
+MODULE_VERSION = 5.15.8
diff --git a/src/virtualkeyboard/content/InputPanel.qml b/src/virtualkeyboard/content/InputPanel.qml
index 490811bf..dd14fca6 100644
--- a/src/virtualkeyboard/content/InputPanel.qml
+++ b/src/virtualkeyboard/content/InputPanel.qml
@@ -48,6 +48,17 @@ import QtQuick.VirtualKeyboard 2.1
the module, the \c QT_IM_MODULE environment variable must be set to
\c qtvirtualkeyboard before using InputPanel. For more information, see
\l {Loading the Plugin}.
+
+ \note You can have only one InputPanel instance in your application.
+
+ \section2 InputPanel and modal dialogs
+
+ Qt prevents modal popups from blocking the keyboard UI, as this would make it
+ impossible to use the keyboard to write into a text field within a modal popup.
+ When an input field receives focus during a modal session, the InputPanel item is
+ made a sibling of the Overlay, and given a z-value one above the Overlay's so that
+ it stays on top of the user interface. When the modal session ends, the item is
+ reparented back to the original parent, and the z-value is restored.
*/
Item {
diff --git a/src/virtualkeyboard/doc/src/deployment-guide.qdoc b/src/virtualkeyboard/doc/src/deployment-guide.qdoc
index d7ea786c..1437eb41 100644
--- a/src/virtualkeyboard/doc/src/deployment-guide.qdoc
+++ b/src/virtualkeyboard/doc/src/deployment-guide.qdoc
@@ -34,7 +34,7 @@
\section1 Overview
This document describes how to deploy and use the Qt Virtual Keyboard plugin
-with Qt 5 applications.
+with Qt applications.
\section1 Deployment
@@ -48,31 +48,41 @@ locations:
\li Boot2Qt install path
\row
\li qtvirtualkeyboardplugin
- \li \c $$[QT_INSTALL_PLUGINS]/platforminputcontexts
+ \li \c <QT_INSTALL_PLUGINS>/platforminputcontexts
\li \c /system/plugins/platforminputcontexts
\row
\li qtvirtualkeyboardextensionplugin
- \li \c $$[QT_INSTALL_PLUGINS]/virtualkeyboard
+ \li \c <QT_INSTALL_PLUGINS>/virtualkeyboard
\li \c /system/plugins/virtualkeyboard
\row
\li qtvirtualkeyboardplugin QML files
- \li \c $$[QT_INSTALL_QML]/QtQuick/VirtualKeyboard
+ \li \c <QT_INSTALL_QML>/QtQuick/VirtualKeyboard
\li \c /system/qml/QtQuick/VirtualKeyboard
\row
\li qtvirtualkeyboardstylesplugin
- \li \c $$[QT_INSTALL_QML]/QtQuick/VirtualKeyboard/Styles
+ \li \c <QT_INSTALL_QML>/QtQuick/VirtualKeyboard/Styles
\li \c /system/qml/QtQuick/VirtualKeyboard/Styles
\endtable
+\section2 Dependencies
+
+The Qt Virtual Keyboard plugin \e (qtvirtualkeyboardplugin) has a dependency
+to the \e {libQt\QtMajorVersion}\e{\VirtualKeyboard} library. In addition, the
+plugin depends on Qt Quick. Therefore, a stand-alone application based on
+\l [QtWidgets] {Qt Widgets} must deploy also the
+\e {libQt\QtMajorVersion}\e{Quick} library and its dependencies in order to
+use the virtual keyboard.
+
+Read more at \l {Deploying Qt's Libraries}.
+
\section1 Integration Method
Qt Virtual Keyboard currently supports two alternative integration methods
for using the plugin:
\list
- \li \c Desktop: requires no changes to existing applications.
- The virtual keyboard is available to all of the Qt 5 applications
- in the system.
+ \li \c Desktop: requires no changes to existing applications. The virtual
+ keyboard is available to all Qt applications in the system.
In this integration method, the keyboard is shown in a dedicated
top-level window.
diff --git a/src/virtualkeyboard/qvirtualkeyboardinputcontext_p.cpp b/src/virtualkeyboard/qvirtualkeyboardinputcontext_p.cpp
index cacf33f0..57e0d0c2 100644
--- a/src/virtualkeyboard/qvirtualkeyboardinputcontext_p.cpp
+++ b/src/virtualkeyboard/qvirtualkeyboardinputcontext_p.cpp
@@ -220,8 +220,6 @@ void QVirtualKeyboardInputContextPrivate::registerInputPanel(QObject *inputPanel
VIRTUALKEYBOARD_DEBUG() << "QVirtualKeyboardInputContextPrivate::registerInputPanel():" << inputPanel;
Q_ASSERT(!this->inputPanel);
this->inputPanel = inputPanel;
- if (QQuickItem *item = qobject_cast<QQuickItem *>(inputPanel))
- item->setZ(std::numeric_limits<qreal>::max());
}
void QVirtualKeyboardInputContextPrivate::hideInputPanel()
@@ -279,8 +277,23 @@ void QVirtualKeyboardInputContextPrivate::onInputItemChanged()
high z-order will make sure it gets events also during a modal session.
*/
if (isDesktopPanel.isValid() && !isDesktopPanel.toBool()) {
- if (QQuickWindow *quickWindow = quickItem->window())
- vkbPanel->setParentItem(quickWindow->contentItem());
+ if (QQuickWindow *quickWindow = quickItem->window()) {
+ QQuickItem *overlay = quickWindow->property("_q_QQuickOverlay").value<QQuickItem*>();
+ if (overlay && overlay->isVisible()) {
+ if (vkbPanel->parentItem() != overlay->parentItem()) {
+ inputPanelParentItem = vkbPanel->parentItem();
+ inputPanelZ = vkbPanel->z();
+ vkbPanel->setParentItem(overlay->parentItem());
+ vkbPanel->setZ(overlay->z() + 1);
+ }
+ } else {
+ if (QQuickItem *oldParentItem = qobject_cast<QQuickItem *>(inputPanelParentItem.data())) {
+ vkbPanel->setParentItem(oldParentItem);
+ vkbPanel->setZ(inputPanelZ);
+ inputPanelParentItem = nullptr;
+ }
+ }
+ }
}
}
}
diff --git a/src/virtualkeyboard/qvirtualkeyboardinputcontext_p.h b/src/virtualkeyboard/qvirtualkeyboardinputcontext_p.h
index 54491e76..e34681fc 100644
--- a/src/virtualkeyboard/qvirtualkeyboardinputcontext_p.h
+++ b/src/virtualkeyboard/qvirtualkeyboardinputcontext_p.h
@@ -153,6 +153,8 @@ private:
QVirtualKeyboardInputEngine *inputEngine;
QtVirtualKeyboard::ShiftHandler *_shiftHandler;
QPointer<QObject> inputPanel;
+ QPointer<QObject> inputPanelParentItem;
+ qreal inputPanelZ = .0;
QRectF keyboardRect;
QRectF previewRect;
bool _previewVisible;
diff --git a/tests/auto/inputpanel/BLACKLIST b/tests/auto/inputpanel/BLACKLIST
new file mode 100644
index 00000000..c55a7fc6
--- /dev/null
+++ b/tests/auto/inputpanel/BLACKLIST
@@ -0,0 +1,22 @@
+# See qtbase/src/testlib/qtestblacklist.cpp for format
+
+# QTBUG-97830
+[tst_plugin::test_fullScreenModeSelectionHandles:row 0]
+*
+
+# QTBUG-97830
+[tst_plugin::test_selection:row 0]
+*
+
+# QTBUG-97989
+[tst_plugin::test_fullScreenModeWordReselection]
+b2qt
+
+[tst_plugin::test_hangulInputMethod:row 25]
+b2qt
+
+[tst_plugin::test_hardKeyBackspaceClearsInput]
+b2qt
+
+[tst_plugin::test_spellCorrectionAutomaticSpaceInsertion:row 11]
+b2qt