diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-03-06 11:58:23 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-04-08 20:43:21 +0200 |
commit | 7cea5aad257b12b34c8fec89cc4750fe0f3c4bbb (patch) | |
tree | 51c1e06dbd3bdd7d1107e403ccb03e2b640222a9 /sources/shiboken6/ApiExtractor/typesystemparser.cpp | |
parent | 91f5d795afc4dc8989237bf7c6b2a83fe5cabcb6 (diff) |
shiboken6: Add attributes for global inline namespaces
Pick-to: 6.7
Fixes: PYSIDE-2590
Change-Id: I36ce25bc759cd888f80b797d4f40864c3d2e2a84
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/typesystemparser.cpp')
-rw-r--r-- | sources/shiboken6/ApiExtractor/typesystemparser.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sources/shiboken6/ApiExtractor/typesystemparser.cpp b/sources/shiboken6/ApiExtractor/typesystemparser.cpp index 22cb0a0ba..1c1565ac2 100644 --- a/sources/shiboken6/ApiExtractor/typesystemparser.cpp +++ b/sources/shiboken6/ApiExtractor/typesystemparser.cpp @@ -2088,6 +2088,8 @@ TypeSystemTypeEntryPtr TypeSystemParser::parseRootElement(const ConditionalStrea { TypeSystem::SnakeCase snakeCase = TypeSystem::SnakeCase::Unspecified; QString subModuleOf; + QString namespaceBegin; + QString namespaceEnd; for (auto i = attributes->size() - 1; i >= 0; --i) { const auto name = attributes->at(i).qualifiedName(); @@ -2124,6 +2126,10 @@ TypeSystemTypeEntryPtr TypeSystemParser::parseRootElement(const ConditionalStrea } } else if (name == subModuleOfAttribute) { subModuleOf = attributes->takeAt(i).value().toString(); + } else if (name == "namespace-begin"_L1) { + namespaceBegin = attributes->takeAt(i).value().toString(); + } else if (name == "namespace-end"_L1) { + namespaceEnd = attributes->takeAt(i).value().toString(); } } @@ -2144,6 +2150,10 @@ TypeSystemTypeEntryPtr TypeSystemParser::parseRootElement(const ConditionalStrea } moduleEntry->setCodeGeneration(m_generate); moduleEntry->setSnakeCase(snakeCase); + if (!namespaceBegin.isEmpty()) + moduleEntry->setNamespaceBegin(namespaceBegin); + if (!namespaceEnd.isEmpty()) + moduleEntry->setNamespaceEnd(namespaceEnd); if ((m_generate == TypeEntry::GenerateForSubclass || m_generate == TypeEntry::GenerateNothing) && !m_defaultPackage.isEmpty()) |