summaryrefslogtreecommitdiffstats
path: root/src/tools/uic/cpp/cppwriteincludes.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2024-07-05 10:35:57 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2024-07-06 13:10:36 +0200
commit6346c5b426935a767575ea758e99749bc6544f54 (patch)
treee222b7d89915fc2b451f8fe5a6b4b7f9c02d839d /src/tools/uic/cpp/cppwriteincludes.cpp
parentd1a5e602df5978cee6bd263db77745f8047e508e (diff)
uic: Fix some clang-tidy warnings
- Repeated return types - Make member functions static - narrowing int conversions - Use auto * - Use list.isEmpty() - Use modern includes - Remove redundant access specifiers - minor fixes Pick-to: 6.8 Change-Id: I14ddf1add667536739fbb5fabb357dbaa7ef35c3 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Diffstat (limited to 'src/tools/uic/cpp/cppwriteincludes.cpp')
-rw-r--r--src/tools/uic/cpp/cppwriteincludes.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tools/uic/cpp/cppwriteincludes.cpp b/src/tools/uic/cpp/cppwriteincludes.cpp
index 7cf7c4e59e4..8203a033f50 100644
--- a/src/tools/uic/cpp/cppwriteincludes.cpp
+++ b/src/tools/uic/cpp/cppwriteincludes.cpp
@@ -11,7 +11,7 @@
#include <qfileinfo.h>
#include <qtextstream.h>
-#include <stdio.h>
+#include <cstdio>
QT_BEGIN_NAMESPACE
@@ -41,7 +41,7 @@ WriteIncludes::WriteIncludes(Uic *uic) : WriteIncludesBase(uic),
for (const auto &e : classInfoEntries()) {
const QString klass = QLatin1StringView(e.klass);
const QString module = QLatin1StringView(e.module);
- QLatin1StringView header = QLatin1StringView(e.header);
+ QLatin1StringView header(e.header);
if (klass.contains(namespaceDelimiter)) {
m_classToHeader.insert(klass, moduleHeader(module, header));
} else {
@@ -73,7 +73,7 @@ void WriteIncludes::acceptUI(DomUI *node)
void WriteIncludes::insertIncludeForClass(const QString &className, QString header, bool global)
{
if (debugWriteIncludes)
- fprintf(stderr, "%s %s '%s' %d\n", Q_FUNC_INFO, qPrintable(className), qPrintable(header), global);
+ std::fprintf(stderr, "%s %s '%s' %d\n", Q_FUNC_INFO, qPrintable(className), qPrintable(header), global);
do {
if (!header.isEmpty())
@@ -91,7 +91,7 @@ void WriteIncludes::insertIncludeForClass(const QString &className, QString head
// Remove namespaces
QString lowerClassName = className.toLower();
static const auto namespaceSeparator = "::"_L1;
- const int namespaceIndex = lowerClassName.lastIndexOf(namespaceSeparator);
+ const auto namespaceIndex = lowerClassName.lastIndexOf(namespaceSeparator);
if (namespaceIndex != -1)
lowerClassName.remove(0, namespaceIndex + namespaceSeparator.size());
if (m_includeBaseNames.contains(lowerClassName)) {