diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-09-21 08:43:01 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-09-21 08:43:01 +0200 |
commit | 98eb59226aca550ae086c00b9c8023f47c44d2b2 (patch) | |
tree | 7e8a136347b5eb52ca0592b33aea09af97bf978a /sources/shiboken2/generator/shiboken2/cppgenerator.cpp | |
parent | 968e9adeccddfc7e3bc376e7b7606b376d8feecf (diff) | |
parent | 8728594d6b2e0f3df3e3726b67cf23715dfdcbe3 (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ia31df23a16575f9ecefe13ec85fb70197d103278
Diffstat (limited to 'sources/shiboken2/generator/shiboken2/cppgenerator.cpp')
-rw-r--r-- | sources/shiboken2/generator/shiboken2/cppgenerator.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp index 7217595ee..831d05d6a 100644 --- a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp +++ b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp @@ -404,8 +404,9 @@ void CppGenerator::generateClass(QTextStream &s, const GeneratorContext &classCo { const AbstractMetaClass *context = metaClass->enclosingClass(); while (context) { - if (context->isNamespace() && !context->enclosingClass()) { - s << "using namespace " << context->qualifiedCppName() << ";\n"; + if (context->isNamespace() && !context->enclosingClass() + && static_cast<const NamespaceTypeEntry *>(context->typeEntry())->generateUsing()) { + s << "\nusing namespace " << context->qualifiedCppName() << ";\n"; break; } context = context->enclosingClass(); |