aboutsummaryrefslogtreecommitdiffstats
path: root/sources
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-10-29 16:37:16 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-10-30 13:04:30 +0000
commitf6ad4b04c0f2ac3fe1437df7a078c247c4bc96fb (patch)
tree300a6cae5c5873f4da9ab9cf5f632f4141707f4e /sources
parent40483a4249306b62029987d03e7de57d456954b2 (diff)
shiboken6: Enable declaring functions on container types
Give the type a parse stack entry. Previously, they ended up in the global functions. Task-number: PYSIDE-904 Task-number: PYSIDE-1339 Change-Id: Ie62dbc0e21ff4c81ef22f98973ab20c3cd85e03a Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources')
-rw-r--r--sources/shiboken6/ApiExtractor/typesystemparser.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/sources/shiboken6/ApiExtractor/typesystemparser.cpp b/sources/shiboken6/ApiExtractor/typesystemparser.cpp
index c52a2e843..369d41a44 100644
--- a/sources/shiboken6/ApiExtractor/typesystemparser.cpp
+++ b/sources/shiboken6/ApiExtractor/typesystemparser.cpp
@@ -790,6 +790,7 @@ bool TypeSystemParser::endElement(QStringView localName)
case StackElement::ObjectTypeEntry:
case StackElement::ValueTypeEntry:
case StackElement::InterfaceTypeEntry:
+ case StackElement::ContainerTypeEntry:
case StackElement::NamespaceTypeEntry: {
auto *centry = static_cast<ComplexTypeEntry *>(m_current->entry);
auto top = m_contextStack.top();
@@ -906,6 +907,7 @@ bool TypeSystemParser::endElement(QStringView localName)
case StackElement::ValueTypeEntry:
case StackElement::PrimitiveTypeEntry:
case StackElement::TypedefTypeEntry:
+ case StackElement::ContainerTypeEntry:
delete m_contextStack.pop();
break;
default:
@@ -2224,7 +2226,8 @@ bool TypeSystemParser::parseAddFunction(const QXmlStreamReader &,
StackElement::ElementType t,
QXmlStreamAttributes *attributes)
{
- if (!(topElement.type & (StackElement::ComplexTypeEntryMask | StackElement::Root))) {
+ if (!(topElement.type
+ & (StackElement::ComplexTypeEntryMask | StackElement::Root | StackElement::ContainerTypeEntry))) {
m_error = QString::fromLatin1("Add/Declare function requires a complex/container type or a root tag as parent"
", was=%1").arg(topElement.type, 0, 16);
return false;
@@ -2816,6 +2819,7 @@ bool TypeSystemParser::startElement(const QXmlStreamReader &reader)
case StackElement::ValueTypeEntry:
case StackElement::PrimitiveTypeEntry:
case StackElement::TypedefTypeEntry:
+ case StackElement::ContainerTypeEntry:
m_contextStack.push(new StackElementContext());
break;
default: