aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktextinput.cpp
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@qt.io>2021-11-01 13:30:21 +0100
committerRichard Moe Gustavsen <richard.gustavsen@qt.io>2021-11-02 11:34:25 +0100
commite7dff7b13a2ff1a50e26c9961808a6818cd7445e (patch)
tree8c22e67ab6043953f9d3d6dbf513b0ecc432dbd1 /src/quick/items/qquicktextinput.cpp
parent8b50506d56e3fbe7fff353df3665e044214a2a39 (diff)
qquicktextinput: Allow adjusting selections through IM
Even if a TextInput is readOnly, it doesn't mean that Qt, or the application itself, cannot change the text. It's user input that is restricted. E.g a call to QQuickTextInput::setText() will change the text even if it's read-only. Moreover, QPA plugins (iOS) might adjust a selection in the input by letting the user drag on selection handles. And for this, IM events are also used. The QPA plugins will still need to (as before) check if the focus object has Qt::ImEnabled or Qt::ImReadOnly before changing the text. Therefore, this patch will remove the check before processing an IM event. Change-Id: Id2d9b54df3606108e3dafce34fdb2843668bd9c6 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/items/qquicktextinput.cpp')
-rw-r--r--src/quick/items/qquicktextinput.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp
index 81907ecbdd..3978bf2890 100644
--- a/src/quick/items/qquicktextinput.cpp
+++ b/src/quick/items/qquicktextinput.cpp
@@ -1523,11 +1523,7 @@ void QQuickTextInput::inputMethodEvent(QInputMethodEvent *ev)
{
Q_D(QQuickTextInput);
const bool wasComposing = d->hasImState;
- if (d->m_readOnly) {
- ev->ignore();
- } else {
- d->processInputMethodEvent(ev);
- }
+ d->processInputMethodEvent(ev);
if (!ev->isAccepted())
QQuickImplicitSizeItem::inputMethodEvent(ev);