aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-05-25 16:33:12 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-05-25 16:33:12 +0200
commit39ac266455cc1c0ae970a47c34d3a6bc7372d750 (patch)
tree9577fe06bcb0e3096ef85af929a91eb37b037452 /sources/shiboken2/generator/shiboken2/cppgenerator.cpp
parent9115712ef3a1be8b401c9cd306792dbc30c89bf0 (diff)
parent6717d3540fac74c91d9381958a08e60f6532d402 (diff)
Merge remote-tracking branch 'origin/5.14' into 5.14.2
Diffstat (limited to 'sources/shiboken2/generator/shiboken2/cppgenerator.cpp')
-rw-r--r--sources/shiboken2/generator/shiboken2/cppgenerator.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
index c0c54f274..64467e3d1 100644
--- a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
+++ b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
@@ -4037,8 +4037,10 @@ void CppGenerator::writeClassDefinition(QTextStream &s,
}
s << INDENT << "{0, " << NULL_PTR << "}\n";
s << "};\n";
+
+ int packageLevel = packageName().count(QLatin1Char('.')) + 1;
s << "static PyType_Spec " << className << "_spec = {\n";
- s << INDENT << "\"" << computedClassTargetFullName << "\",\n";
+ s << INDENT << '"' << packageLevel << ':' << computedClassTargetFullName << "\",\n";
s << INDENT << "sizeof(SbkObject),\n";
s << INDENT << "0,\n";
s << INDENT << tp_flags << ",\n";
@@ -4667,6 +4669,7 @@ void CppGenerator::writeEnumInitialization(QTextStream &s, const AbstractMetaEnu
QString enumVarTypeObj;
if (!cppEnum->isAnonymous()) {
+ int packageLevel = packageName().count(QLatin1Char('.')) + 1;
FlagsTypeEntry *flags = enumTypeEntry->flags();
if (flags) {
// The following could probably be made nicer:
@@ -4674,7 +4677,7 @@ void CppGenerator::writeEnumInitialization(QTextStream &s, const AbstractMetaEnu
QString fullPath = getClassTargetFullName(cppEnum);
fullPath.truncate(fullPath.lastIndexOf(QLatin1Char('.')) + 1);
s << INDENT << cpythonTypeNameExt(flags) << " = PySide::QFlags::create(\""
- << fullPath << flags->flagsName() << "\", "
+ << packageLevel << ':' << fullPath << flags->flagsName() << "\", "
<< cpythonEnumName(cppEnum) << "_number_slots);\n";
}
@@ -4686,7 +4689,7 @@ void CppGenerator::writeEnumInitialization(QTextStream &s, const AbstractMetaEnu
{
Indentation indent(INDENT);
s << INDENT << '"' << cppEnum->name() << "\",\n";
- s << INDENT << '"' << getClassTargetFullName(cppEnum) << "\",\n";
+ s << INDENT << '"' << packageLevel << ':' << getClassTargetFullName(cppEnum) << "\",\n";
s << INDENT << '"' << (cppEnum->enclosingClass() ? (cppEnum->enclosingClass()->qualifiedCppName() + QLatin1String("::")) : QString());
s << cppEnum->name() << '"';
if (flags)