summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2022-06-16 10:48:47 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-06-20 08:17:46 +0000
commit3b8288c1bdedbbeb802c1d910aa47583483e7f8f (patch)
tree3c4444499efd2cf0c25f20fb64ec1ca6e14858c7
parent2d55aa2cc4faa33104398fd0bd69e7e184c79fd6 (diff)
qtdiag: Fix missing output on Windows
Streaming passwordMaskCharacter.unicode() (char16_t) in the non-ASCII branch caused weird effects on the terminal. Cast to int instead. Change-Id: Ifca5cc8c8d83bb98bfbd220405fd9f714b59a63e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 51edc6fd26153718217a2266b5b1592a6bc7ee97) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/qtdiag/qtdiag.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/qtdiag/qtdiag.cpp b/src/qtdiag/qtdiag.cpp
index 87b00e7d1..b3d521fa6 100644
--- a/src/qtdiag/qtdiag.cpp
+++ b/src/qtdiag/qtdiag.cpp
@@ -704,10 +704,13 @@ QString qtDiag(unsigned flags)
<< " showIsMaximized: " << styleHints->showIsMaximized() << '\n'
<< " passwordMaskDelay: " << styleHints->passwordMaskDelay() << '\n'
<< " passwordMaskCharacter: ";
- if (passwordMaskCharacter.unicode() >= 32 && passwordMaskCharacter.unicode() < 128)
+ const int passwordMaskCharacterUc = passwordMaskCharacter.unicode();
+ if (passwordMaskCharacterUc >= 32 && passwordMaskCharacterUc < 128) {
str << '\'' << passwordMaskCharacter << '\'';
- else
- str << "U+" << qSetFieldWidth(4) << qSetPadChar('0') << Qt::uppercasedigits << Qt::hex << passwordMaskCharacter.unicode() << Qt::dec << qSetFieldWidth(0);
+ } else {
+ str << "U+" << qSetFieldWidth(4) << qSetPadChar('0') << Qt::uppercasedigits << Qt::hex
+ << passwordMaskCharacterUc << Qt::dec << qSetFieldWidth(0);
+ }
str << '\n'
<< " fontSmoothingGamma: " << styleHints->fontSmoothingGamma() << '\n'
<< " useRtlExtensions: " << styleHints->useRtlExtensions() << '\n'