diff options
author | Liang Qi <liang.qi@qt.io> | 2020-12-17 17:22:48 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-01-05 17:29:40 +0000 |
commit | 51e940260af183228798c7741646ac88252e1f3b (patch) | |
tree | f03ebefdab66a96aec594b3066466f8ffb57c049 /src | |
parent | 562fb69d75c48f6d116134537ff502ddbc12e763 (diff) |
QInputControl: accept surrogate category character
See also https://unicodebook.readthedocs.io/unicode_encodings.html#utf-16-surrogate-pairs .
Fixes: QTBUG-89184
Change-Id: I04eff7f42f0030346603a7b31e4ac854a477030c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit e688b99995b8c624dbcea296c99fb89262d29e15)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/text/qinputcontrol.cpp | 3 |
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; |