diff options
author | Christian Tismer <tismer@stackless.com> | 2018-07-15 15:43:10 +0200 |
---|---|---|
committer | Christian Tismer <tismer@stackless.com> | 2018-07-16 10:24:51 +0000 |
commit | d794b7a748b82daa1af2a32b4c6a02d12d7626dc (patch) | |
tree | 835e4d85caa487e982d140a0b3b4d7662d443f17 /sources/shiboken2 | |
parent | 5571597b4bdcfb9fbfbdbbf69665491a089fe847 (diff) |
Generate fully Qualified Names for Flags
The flags structure should give correct full names.
See the doc in the issue tracker.
Task-number: PYSIDE-747
Change-Id: I6b5c602566d3e4b8a2a93e2522e92da956578b18
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/shiboken2')
-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); |