aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/generator/shiboken2
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-07-20 08:05:42 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-07-20 08:05:48 +0200
commit22db3abf70308a7152789c6f92b8be764e6c18b8 (patch)
treebed2f2304a605e760e314100719deaa56517a3f4 /sources/shiboken2/generator/shiboken2
parente0e44f0fd5b05ee299bd4e377b0d4a302c442aae (diff)
parenta1b09497f2f198e6ea523637321a0e11fa310d9c (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Diffstat (limited to 'sources/shiboken2/generator/shiboken2')
-rw-r--r--sources/shiboken2/generator/shiboken2/cppgenerator.cpp9
1 files changed, 7 insertions, 2 deletions
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);