diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-04-13 17:21:47 +0200 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-04-23 09:47:03 +0200 |
commit | fedba8eaab464e9218afb4d11c7a77ddb5f09c40 (patch) | |
tree | aeb9d0d978dd59bab4fb8c87ac7472a977479cf7 /src/tools/uic/uic.cpp | |
parent | 3aef84d6002016e6f764a0c2924bb5a802e9cb64 (diff) |
uic: stop using QLatin1Char constructor for creating char literals
Required for porting away from QLatin1Char/QLatin1String in scope of
QTBUG-98434.
As a drive-by, fix qsizetype -> int narrowing conversion warnings for
the touched lines.
Change-Id: I0d3c232a9fa95aea854445922f100b89c6d6f5a1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/tools/uic/uic.cpp')
-rw-r--r-- | src/tools/uic/uic.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tools/uic/uic.cpp b/src/tools/uic/uic.cpp index 3601280144..5fa5661f87 100644 --- a/src/tools/uic/uic.cpp +++ b/src/tools/uic/uic.cpp @@ -127,7 +127,7 @@ void Uic::writeCopyrightHeaderCpp(const DomUI *ui) const static inline bool isCppCommentChar(QChar c) { - return c == QLatin1Char('/') || c == QLatin1Char('*'); + return c == u'/' || c == u'*'; } static int leadingCppCommentCharCount(QStringView s) @@ -142,13 +142,13 @@ void Uic::writeCopyrightHeaderPython(const DomUI *ui) const { QString comment = ui->elementComment(); if (!comment.isEmpty()) { - const auto lines = QStringView{comment}.split(QLatin1Char('\n')); + const auto lines = QStringView{comment}.split(u'\n'); for (const auto &line : lines) { if (const int leadingCommentChars = leadingCppCommentCharCount(line)) { out << language::repeat(leadingCommentChars, '#') << line.right(line.size() - leadingCommentChars); } else { - if (!line.startsWith(QLatin1Char('#'))) + if (!line.startsWith(u'#')) out << "# "; out << line; } |