summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2020-12-17 17:22:48 +0100
committerLiang Qi <liang.qi@qt.io>2021-01-05 16:24:29 +0100
commite688b99995b8c624dbcea296c99fb89262d29e15 (patch)
treefc077f29466d14b7938cc034c68f75695c64e7e9 /src/gui/text
parent34f08414512ae0a486f526066126566d8bd4cb9f (diff)
QInputControl: accept surrogate category character
See also https://unicodebook.readthedocs.io/unicode_encodings.html#utf-16-surrogate-pairs . Fixes: QTBUG-89184 Pick-to: 6.0 5.15 Change-Id: I04eff7f42f0030346603a7b31e4ac854a477030c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qinputcontrol.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/text/qinputcontrol.cpp b/src/gui/text/qinputcontrol.cpp
index 3381fdb673..80d5e6af4e 100644
--- a/src/gui/text/qinputcontrol.cpp
+++ b/src/gui/text/qinputcontrol.cpp
@@ -79,6 +79,9 @@ bool QInputControl::isAcceptableInput(const QKeyEvent *event) const
if (c.category() == QChar::Other_PrivateUse)
return true;
+ if (c.isHighSurrogate() && text.length() > 1 && text.at(1).isLowSurrogate())
+ return true;
+
if (m_type == TextEdit && c == QLatin1Char('\t'))
return true;