From 7b1ba955a6da3d4414fa206ec1c06c1fc6e16161 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 18 Jan 2023 17:26:08 +0100 Subject: uic: Add a -no-qt-namespace option To suppress the generation of the Ui class within QT_BEGIN_NAMESPACE and QT_END_NAMESPACE. Change-Id: I6552b41d8e9eccb0475618d7ed7f7cea7f826625 Reviewed-by: Friedemann Kleint Reviewed-by: Qt CI Bot --- src/tools/uic/cpp/cppwritedeclaration.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 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 910c4e2ee25..8261963cfaa 100644 --- a/src/tools/uic/cpp/cppwritedeclaration.cpp +++ b/src/tools/uic/cpp/cppwritedeclaration.cpp @@ -65,8 +65,8 @@ void WriteDeclaration::acceptUI(DomUI *node) // is a User using Qt-in-namespace having his own classes not in a namespace. // 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 = namespaceList.size() == 0 - || namespaceList[0] == "qdesigner_internal"_L1; + const bool needsMacro = m_option.qtNamespace && + (namespaceList.size() == 0 || namespaceList[0] == "qdesigner_internal"_L1); if (needsMacro) m_output << "QT_BEGIN_NAMESPACE\n\n"; -- cgit v1.2.3