diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-07-05 10:35:57 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-07-06 13:10:36 +0200 |
| commit | 6346c5b426935a767575ea758e99749bc6544f54 (patch) | |
| tree | e222b7d89915fc2b451f8fe5a6b4b7f9c02d839d /src/tools/uic/cpp/cppwritedeclaration.cpp | |
| parent | d1a5e602df5978cee6bd263db77745f8047e508e (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/cppwritedeclaration.cpp')
| -rw-r--r-- | src/tools/uic/cpp/cppwritedeclaration.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/tools/uic/cpp/cppwritedeclaration.cpp b/src/tools/uic/cpp/cppwritedeclaration.cpp index 8261963cfaa..d3809ec87a2 100644 --- a/src/tools/uic/cpp/cppwritedeclaration.cpp +++ b/src/tools/uic/cpp/cppwritedeclaration.cpp @@ -55,7 +55,7 @@ void WriteDeclaration::acceptUI(DomUI *node) exportMacro.append(u' '); QStringList namespaceList = qualifiedClassName.split("::"_L1); - if (namespaceList.size()) { + if (!namespaceList.isEmpty()) { className = namespaceList.last(); namespaceList.removeLast(); } @@ -66,14 +66,14 @@ void WriteDeclaration::acceptUI(DomUI *node) // In this case the generated Ui helper classes will also end up in // the Qt namespace (which is harmless, but not "pretty") const bool needsMacro = m_option.qtNamespace && - (namespaceList.size() == 0 || namespaceList[0] == "qdesigner_internal"_L1); + (namespaceList.isEmpty() || namespaceList.at(0) == "qdesigner_internal"_L1); if (needsMacro) m_output << "QT_BEGIN_NAMESPACE\n\n"; openNameSpaces(namespaceList, m_output); - if (namespaceList.size()) + if (!namespaceList.isEmpty()) m_output << "\n"; m_output << "class " << exportMacro << m_option.prefix << className << "\n" @@ -98,7 +98,7 @@ void WriteDeclaration::acceptUI(DomUI *node) closeNameSpaces(namespaceList, m_output); - if (namespaceList.size()) + if (!namespaceList.isEmpty()) m_output << "\n"; if (m_option.generateNamespace && !m_option.prefix.isEmpty()) { @@ -110,7 +110,7 @@ void WriteDeclaration::acceptUI(DomUI *node) closeNameSpaces(namespaceList, m_output); - if (namespaceList.size()) + if (!namespaceList.isEmpty()) m_output << "\n"; } @@ -124,7 +124,7 @@ void WriteDeclaration::acceptWidget(DomWidget *node) if (node->hasAttributeClass()) className = node->attributeClass(); - m_output << m_option.indent << m_uic->customWidgetsInfo()->realClassName(className) << " *" << m_driver->findOrInsertWidget(node) << ";\n"; + m_output << m_option.indent << CustomWidgetsInfo::realClassName(className) << " *" << m_driver->findOrInsertWidget(node) << ";\n"; TreeWalker::acceptWidget(node); } |
