aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/ApiExtractor/typesystemparser.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2023-11-23 12:06:31 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2023-12-08 14:09:58 +0100
commit8854d73e82ab2b1b917314d5c573e2dae197b34a (patch)
treef6157be219cd734868a2f253206679a1e744a48a /sources/shiboken6/ApiExtractor/typesystemparser.cpp
parentc94e47c89697f569ea908ff2714ec56da0bc3458 (diff)
shiboken6: Add typesystem attribute to suppress the meta object functions
[ChangeLog][shiboken6] Generating the Qt meta object functions handling the PySide6 signals can now be disabled by a typesystem attribute. This is useful for classes using dynamic meta objects, for example QDBusInterface. Task-number: PYSIDE-2535 Change-Id: I9af344b40abbf859388a2cf2e5ab459bbf3c00a5 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/typesystemparser.cpp')
-rw-r--r--sources/shiboken6/ApiExtractor/typesystemparser.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/sources/shiboken6/ApiExtractor/typesystemparser.cpp b/sources/shiboken6/ApiExtractor/typesystemparser.cpp
index 129aefc82..32c833fd8 100644
--- a/sources/shiboken6/ApiExtractor/typesystemparser.cpp
+++ b/sources/shiboken6/ApiExtractor/typesystemparser.cpp
@@ -92,6 +92,7 @@ constexpr auto preferredConversionAttribute = "preferred-conversion"_L1;
constexpr auto preferredTargetLangTypeAttribute = "preferred-target-lang-type"_L1;
constexpr auto pythonEnumTypeAttribute = "python-type"_L1;
constexpr auto cppEnumTypeAttribute = "cpp-type"_L1;
+constexpr auto qtMetaObjectFunctionsAttribute = "qt-metaobject"_L1;
constexpr auto qtMetaTypeAttribute = "qt-register-metatype"_L1;
constexpr auto removeAttribute = "remove"_L1;
constexpr auto renameAttribute = "rename"_L1;
@@ -1863,6 +1864,12 @@ void TypeSystemParser::applyComplexTypeAttributes(const ConditionalStreamReader
} else if (name == deleteInMainThreadAttribute) {
if (convertBoolean(attributes->takeAt(i).value(), deleteInMainThreadAttribute, false))
ctype->setDeleteInMainThread(true);
+ } else if (name == qtMetaObjectFunctionsAttribute) {
+ if (!convertBoolean(attributes->takeAt(i).value(),
+ qtMetaObjectFunctionsAttribute, true)) {
+ ctype->setTypeFlags(ctype->typeFlags()
+ | ComplexTypeEntry::DisableQtMetaObjectFunctions);
+ }
} else if (name == generateFunctionsAttribute) {
const auto names = attributes->takeAt(i).value();
const auto nameList = names.split(u';', Qt::SkipEmptyParts);