diff options
author | Andy Shaw <andy.shaw@qt.io> | 2020-03-02 10:29:23 +0100 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2020-03-02 12:54:23 +0100 |
commit | df034c07be4828778d43a4037f89f31ac26f411d (patch) | |
tree | bf83d085996660aab5a2d60e9996c4c9496d9123 | |
parent | d4748c7c936cdf603e0b72bfdb4e39f822ab2e9d (diff) |
Don't replace all characters below 0x20 with spaces as they may be valid
Some fonts will still render something for characters below 0x20 so
these should not be replaced with a space and should just be left as is.
It will not be rendered as a box if the dontPrint flag is set so we can
trust the renderer to do the right thing here.
Change-Id: Ie091c14713d8c2948c82b1991c295d80bc35dfde
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
-rw-r--r-- | src/quick/items/qquicktextinput.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp index 11a6600b74..ee51711d34 100644 --- a/src/quick/items/qquicktextinput.cpp +++ b/src/quick/items/qquicktextinput.cpp @@ -2901,8 +2901,7 @@ void QQuickTextInputPrivate::updateDisplayText(bool forceUpdate) // characters) QChar* uc = str.data(); for (int i = 0; i < str.length(); ++i) { - if ((uc[i].unicode() < 0x20 && uc[i] != QChar::Tabulation) - || uc[i] == QChar::LineSeparator + if (uc[i] == QChar::LineSeparator || uc[i] == QChar::ParagraphSeparator || uc[i] == QChar::ObjectReplacementCharacter) uc[i] = QChar(0x0020); |