From b6eaa63a81654459827851a261ad50829cc511ba Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 14 Sep 2020 10:37:10 +0200 Subject: Remove dependency of the QtQml module header on pysideqmlregistertype.h Make it possible to inject code into module headers by specifying "declaration" on type system code snippets. Use that to insert the struct definition into pyside2_qtqml_python.h and remove the include. Add the required includes via code injection into the wrapper and extra includes for the types. Fixes: PYSIDE-1381 Change-Id: I8dfda4c33d66f56e8fb516e1b174cc43664ca318 Reviewed-by: Christian Tismer --- sources/shiboken2/generator/shiboken2/headergenerator.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sources/shiboken2/generator') diff --git a/sources/shiboken2/generator/shiboken2/headergenerator.cpp b/sources/shiboken2/generator/shiboken2/headergenerator.cpp index 8b3fe1653..cd99d76be 100644 --- a/sources/shiboken2/generator/shiboken2/headergenerator.cpp +++ b/sources/shiboken2/generator/shiboken2/headergenerator.cpp @@ -391,6 +391,12 @@ bool HeaderGenerator::finishGeneration() QString protectedEnumSurrogates; QTextStream protEnumsSurrogates(&protectedEnumSurrogates); + const auto snips = TypeDatabase::instance()->defaultTypeSystemType()->codeSnips(); + if (!snips.isEmpty()) { + writeCodeSnips(macrosStream, snips, TypeSystem::CodeSnipPositionDeclaration, + TypeSystem::TargetLangCode); + } + Indentation indent(INDENT); macrosStream << "// Type indices\nenum : int {\n"; -- cgit v1.2.3