From abc024eef78cfc84a577ce9f1638c5b6dc4d101b Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 31 Jul 2018 16:03:59 +0200 Subject: uic: Fix clang-tidy warnings - Simplify/streamline if statmenents - Change else if to if after return/break/continue - Use isEmpty() for containers instead of checking size() - Replace index-based loops by range-based for Change-Id: I008228a99082a4d0e27be9f6c6af392602140b2f Reviewed-by: Jarek Kobus --- src/tools/uic/cpp/cppwritedeclaration.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'src/tools/uic/cpp/cppwritedeclaration.cpp') diff --git a/src/tools/uic/cpp/cppwritedeclaration.cpp b/src/tools/uic/cpp/cppwritedeclaration.cpp index 9e774ad07b7..995b99b6923 100644 --- a/src/tools/uic/cpp/cppwritedeclaration.cpp +++ b/src/tools/uic/cpp/cppwritedeclaration.cpp @@ -40,10 +40,11 @@ QT_BEGIN_NAMESPACE namespace { - void openNameSpaces(const QStringList &namespaceList, QTextStream &output) { - for (auto it = namespaceList.begin(), end = namespaceList.end(); it != end; ++it) { - if (!it->isEmpty()) - output << "namespace " << *it << " {\n"; + void openNameSpaces(const QStringList &namespaceList, QTextStream &output) + { + for (const QString &n : namespaceList) { + if (!n.isEmpty()) + output << "namespace " << n << " {\n"; } } @@ -103,13 +104,9 @@ void WriteDeclaration::acceptUI(DomUI *node) << "public:\n"; const QStringList connections = m_uic->databaseInfo()->connections(); - for (int i=0; ielementWidget()); -- cgit v1.2.3