From df034c07be4828778d43a4037f89f31ac26f411d Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 2 Mar 2020 10:29:23 +0100 Subject: 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 --- src/quick/items/qquicktextinput.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/quick') 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); -- cgit v1.2.3