summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2022-09-08 15:15:10 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-09-10 05:21:17 +0000
commit14279ab225bc76f1c06ffa2663dfae44a76840d9 (patch)
tree9a662ea0ee3e29a2c303f64448965c0c8c96a2e8
parentaa77c536a87c32d4a8ef88f0aef7f7b438c64df8 (diff)
PdfSelection: mark read-only for IM to avoid showing virtual keyboard
The Qt::ImReadOnly query enum is new in 6.2 (qtbase c80f262258b7846bf199887bcfdbb6dcfda6ad6f and aae4d52cbb79c61161271473ab5c3a1ba1086e01). It was added to the switch statement in 79d04aa9e3e9aa84d7378260519f9e9a6759dc41 but needs to return `true` to mark this Item as read-only, so that the keyboard will not open when it gets focus. The menu still gets populated with Select and Select All on long-press, and then Copy after a selection is made. That's all we need. The qt_im_readonly property was a sort of private API for Qt 5, and should no longer be needed (albeit the implementation is still in Qt 6 so far). Task-number: QTBUG-83811 Fixes: QTBUG-106358 Change-Id: I677363be545d07884dffdfc10d6fdbd488cf2cf0 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit b37d29b5f3c3572c6f3348545d23d8e42362311c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/pdfquick/qquickpdfselection.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/pdfquick/qquickpdfselection.cpp b/src/pdfquick/qquickpdfselection.cpp
index 11cee1542..ff50bcb23 100644
--- a/src/pdfquick/qquickpdfselection.cpp
+++ b/src/pdfquick/qquickpdfselection.cpp
@@ -46,8 +46,6 @@ QQuickPdfSelection::QQuickPdfSelection(QQuickItem *parent)
{
#if QT_CONFIG(im)
setFlags(ItemIsFocusScope | ItemAcceptsInputMethod);
- // workaround to get Copy instead of Paste on the popover menu (QTBUG-83811)
- setProperty("qt_im_readonly", QVariant(true));
#endif
}
@@ -319,6 +317,7 @@ QVariant QQuickPdfSelection::inputMethodQuery(Qt::InputMethodQuery query) const
case Qt::ImPlatformData:
break;
case Qt::ImReadOnly:
+ ret = true;
break;
case Qt::ImQueryInput:
case Qt::ImQueryAll: