diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-07-20 08:05:42 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-07-20 08:05:48 +0200 |
commit | 22db3abf70308a7152789c6f92b8be764e6c18b8 (patch) | |
tree | bed2f2304a605e760e314100719deaa56517a3f4 /sources/shiboken2/generator | |
parent | e0e44f0fd5b05ee299bd4e377b0d4a302c442aae (diff) | |
parent | a1b09497f2f198e6ea523637321a0e11fa310d9c (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I1b6fdc6b0ac59dd726a9977620f1070bebf237a6
Diffstat (limited to 'sources/shiboken2/generator')
-rw-r--r-- | sources/shiboken2/generator/shiboken2/cppgenerator.cpp | 9 |
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); |