aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-10-07 20:23:32 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-10-08 11:39:35 +0200
commit17d8d5ffa9a132d1ed3c92942605f3857e61ae7b (patch)
tree2109b1741330ff0195d96b76b03cf2b33370f661
parentd3b523ef428d299b4d6e860cfa282da942924cfa (diff)
shiboken2: Enable includes and modifications on typedef entries
Extra includes might be required for the template instantiation type. Add the includes and modifications obtained from parsing the sub-elements to the target entry in endElement(). Complements bfd1de3495b18c0ecc251260442a9a46009861e. Task-number: PYSIDE-725 Task-number: PYSIDE-1202 Change-Id: I71e399879feb641238d4d6035faa3f4c34932a87 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
-rw-r--r--sources/shiboken2/ApiExtractor/typesystemparser.cpp23
1 files changed, 18 insertions, 5 deletions
diff --git a/sources/shiboken2/ApiExtractor/typesystemparser.cpp b/sources/shiboken2/ApiExtractor/typesystemparser.cpp
index 27e613280..6352ce2be 100644
--- a/sources/shiboken2/ApiExtractor/typesystemparser.cpp
+++ b/sources/shiboken2/ApiExtractor/typesystemparser.cpp
@@ -788,13 +788,26 @@ bool TypeSystemParser::endElement(const QStringRef &localName)
case StackElement::InterfaceTypeEntry:
case StackElement::NamespaceTypeEntry: {
auto *centry = static_cast<ComplexTypeEntry *>(m_current->entry);
- centry->setAddedFunctions(m_contextStack.top()->addedFunctions);
- centry->setFunctionModifications(m_contextStack.top()->functionMods);
- centry->setFieldModifications(m_contextStack.top()->fieldMods);
- centry->setCodeSnips(m_contextStack.top()->codeSnips);
- centry->setDocModification(m_contextStack.top()->docModifications);
+ auto top = m_contextStack.top();
+ centry->setAddedFunctions(top->addedFunctions);
+ centry->setFunctionModifications(top->functionMods);
+ centry->setFieldModifications(top->fieldMods);
+ centry->setCodeSnips(top->codeSnips);
+ centry->setDocModification(top->docModifications);
}
break;
+
+ case StackElement::TypedefTypeEntry: {
+ auto *centry = static_cast<TypedefEntry *>(m_current->entry)->target();
+ auto top = m_contextStack.top();
+ centry->setAddedFunctions(centry->addedFunctions() + top->addedFunctions);
+ centry->setFunctionModifications(centry->functionModifications() + top->functionMods);
+ centry->setFieldModifications(centry->fieldModifications() + top->fieldMods);
+ centry->setCodeSnips(centry->codeSnips() + top->codeSnips);
+ centry->setDocModification(centry->docModifications() + top->docModifications);
+ }
+ break;
+
case StackElement::AddFunction: {
// Leaving add-function: Assign all modifications to the added function
StackElementContext *top = m_contextStack.top();