diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2023-08-25 16:04:41 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2023-09-08 18:17:36 +0200 |
commit | 319b2e0e86f0afa6aa48625702010b5a6db4fe38 (patch) | |
tree | 80112f9c7c09099853944406aadcdc0cfd57771c /examples/corelib/serialization/convert/nullconverter.cpp | |
parent | e4d545b4c6d5f14fa538cbfc40f0134ea28e9419 (diff) |
corelib/serialization examples: use string literals more
A couple more compilation units could use Qt::StringLiterals. Prefer
QL1SV for the code constants, to keep code small. Convert fpToString()
to take QL1SV instead of const char *, with suffix empty by default.
Also rearranged some spacing, some if it suggested by clang-tidy.
Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: I03d810d52afcd4a760d18f2553914b75af716b74
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'examples/corelib/serialization/convert/nullconverter.cpp')
-rw-r--r-- | examples/corelib/serialization/convert/nullconverter.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/corelib/serialization/convert/nullconverter.cpp b/examples/corelib/serialization/convert/nullconverter.cpp index 73ae67b796..1b2b0804e5 100644 --- a/examples/corelib/serialization/convert/nullconverter.cpp +++ b/examples/corelib/serialization/convert/nullconverter.cpp @@ -3,12 +3,14 @@ #include "nullconverter.h" +using namespace Qt::StringLiterals; + static NullConverter nullConverter; Converter *Converter::null = &nullConverter; QString NullConverter::name() { - return QLatin1String("null"); + return "null"_L1; } Converter::Direction NullConverter::directions() |