summaryrefslogtreecommitdiffstats
path: root/generator/cppgenerator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'generator/cppgenerator.cpp')
-rw-r--r--generator/cppgenerator.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp
index 2df2bae9..afa1746e 100644
--- a/generator/cppgenerator.cpp
+++ b/generator/cppgenerator.cpp
@@ -170,6 +170,8 @@ void CppGenerator::generateClass(QTextStream &s, const AbstractMetaClass *metaCl
//Extra includes
s << endl << "// Extra includes" << endl;
QList<Include> includes = metaClass->typeEntry()->extraIncludes();
+ foreach (AbstractMetaEnum* cppEnum, metaClass->enums())
+ includes.append(cppEnum->typeEntry()->extraIncludes());
qSort(includes.begin(), includes.end());
foreach (Include inc, includes)
s << inc.toString() << endl;
@@ -3533,6 +3535,16 @@ void CppGenerator::finishGeneration()
s << include;
s << endl;
+ //Extra includes
+ s << endl << "// Extra includes" << endl;
+ QList<Include> includes;
+ foreach (AbstractMetaEnum* cppEnum, globalEnums())
+ includes.append(cppEnum->typeEntry()->extraIncludes());
+ qSort(includes.begin(), includes.end());
+ foreach (Include inc, includes)
+ s << inc.toString() << endl;
+ s << endl;
+
TypeSystemTypeEntry* moduleEntry = reinterpret_cast<TypeSystemTypeEntry*>(TypeDatabase::instance()->findType(packageName()));
CodeSnipList snips;
if (moduleEntry)