aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-05-24 09:47:11 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-05-24 09:47:11 +0200
commit768541fb2e81a426daeffc2f81dcca42ecc43919 (patch)
treef887244a022ea8508055412cb3e85ba8158cf509 /sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
parent6ba23a245449aaa9c1a7ab8e954d93f5f4366530 (diff)
parent235092d72f57d42de04501b04f6a3ff4d77adf74 (diff)
Merge "Merge remote-tracking branch 'origin/5.13' into dev"
Diffstat (limited to 'sources/shiboken2/generator/shiboken2/shibokengenerator.cpp')
-rw-r--r--sources/shiboken2/generator/shiboken2/shibokengenerator.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
index 44405c700..2b3b20c75 100644
--- a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
+++ b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
@@ -2667,8 +2667,14 @@ QString ShibokenGenerator::getTypeIndexVariableName(const TypeEntry* type)
if (trueType->basicReferencedTypeEntry())
type = trueType->basicReferencedTypeEntry();
}
- QString result = QLatin1String("SBK_")
- + _fixedCppTypeName(type->qualifiedCppName()).toUpper();
+ QString result = QLatin1String("SBK_");
+ // Disambiguate namespaces per module to allow for extending them.
+ if (type->isNamespace()) {
+ QString package = type->targetLangPackage();
+ const int dot = package.lastIndexOf(QLatin1Char('.'));
+ result += package.rightRef(package.size() - (dot + 1));
+ }
+ result += _fixedCppTypeName(type->qualifiedCppName()).toUpper();
appendIndexSuffix(&result);
return result;
}