summaryrefslogtreecommitdiffstats
path: root/src/tools/uic/cpp/cppwritedeclaration.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/uic/cpp/cppwritedeclaration.cpp')
-rw-r--r--src/tools/uic/cpp/cppwritedeclaration.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/uic/cpp/cppwritedeclaration.cpp b/src/tools/uic/cpp/cppwritedeclaration.cpp
index 910c4e2ee2..8261963cfa 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";