aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sources/pyside2/libpyside/pysideqflags.cpp4
-rw-r--r--sources/shiboken2/generator/shiboken2/cppgenerator.cpp9
2 files changed, 9 insertions, 4 deletions
diff --git a/sources/pyside2/libpyside/pysideqflags.cpp b/sources/pyside2/libpyside/pysideqflags.cpp
index 11db70bb5..f4263403b 100644
--- a/sources/pyside2/libpyside/pysideqflags.cpp
+++ b/sources/pyside2/libpyside/pysideqflags.cpp
@@ -165,8 +165,8 @@ namespace QFlags
PyTypeObject *create(const char* name, PyType_Slot numberMethods[])
{
char qualname[200];
- strcpy(qualname, "PySide2.libpyside.");
- strcat(qualname, name);
+ // PYSIDE-747: Here we insert now the full class name.
+ strcpy(qualname, name);
// Careful: PyType_FromSpec does not allocate the string.
PyType_Spec *newspec = new PyType_Spec;
newspec->name = strdup(qualname);
diff --git a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
index 568b5fd27..a9556fa4c 100644
--- a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
+++ b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
@@ -4483,8 +4483,13 @@ void CppGenerator::writeEnumInitialization(QTextStream& s, const AbstractMetaEnu
if (!cppEnum->isAnonymous()) {
FlagsTypeEntry* flags = enumTypeEntry->flags();
if (flags) {
- s << INDENT << cpythonTypeNameExt(flags) << " = PySide::QFlags::create(\"" << flags->flagsName() << "\", "
- << cpythonEnumName(cppEnum) << "_number_slots);" << endl;
+ // The following could probably be made nicer:
+ // We need 'flags->flagsName()' with the full module/class path.
+ QString fullPath = getClassTargetFullName(cppEnum);
+ fullPath.truncate(fullPath.lastIndexOf(QLatin1Char('.')) + 1);
+ s << INDENT << cpythonTypeNameExt(flags) << " = PySide::QFlags::create(\""
+ << fullPath << flags->flagsName() << "\", "
+ << cpythonEnumName(cppEnum) << "_number_slots);" << endl;
}
enumVarTypeObj = cpythonTypeNameExt(enumTypeEntry);