From e20e29d1bd03f6ff9e57037d0a7f35bb59604f4e Mon Sep 17 00:00:00 2001 From: Christian Tismer Date: Fri, 2 Dec 2022 13:47:48 +0100 Subject: __feature__: Fix a weird case of false metafunction lookup PySide implements duck-punching since 2010. This could create a problem with true_property since 06/2019, because a meta-function could be found in the instance dict of a QObject class, although the methods were replaced by a property object. This was an unexpected reaction of the `getMetaDataFromQObject` function. Meta methods were created and inserted into the instance dict, which caused very unrelated side effects like infinite recursion. The new implementation handles Python properties correctly and looks up the hidden methods if necessary without side effects. There are no longer meta functions involved. The function `getMetaDataFromQObject` is misleading and was replaced by `getHiddenDataFromQObject`, keeping the old name as an alias. It will be finally removed in version 6.5 . [ChangeLog][PySide6] A callback error when using true_property was fixed. Change-Id: Ie5234eab2106885f6edad24ae7d4c55fff43d62f Fixes: PYSIDE-1889 Pick-to: 6.4 Task-number: PYSIDE-1019 Reviewed-by: Cristian Maureira-Fredes --- sources/shiboken6/generator/shiboken/cppgenerator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sources/shiboken6/generator/shiboken/cppgenerator.cpp') diff --git a/sources/shiboken6/generator/shiboken/cppgenerator.cpp b/sources/shiboken6/generator/shiboken/cppgenerator.cpp index 1b4a04dd4..48006d788 100644 --- a/sources/shiboken6/generator/shiboken/cppgenerator.cpp +++ b/sources/shiboken6/generator/shiboken/cppgenerator.cpp @@ -6438,7 +6438,7 @@ QString CppGenerator::qObjectGetAttroFunction() const if (result.isEmpty()) { auto qobjectClass = AbstractMetaClass::findClass(api().classes(), qObjectT()); Q_ASSERT(qobjectClass); - result = u"PySide::getMetaDataFromQObject("_s + result = u"PySide::getHiddenDataFromQObject("_s + cpythonWrapperCPtr(qobjectClass, u"self"_s) + u", self, name)"_s; } -- cgit v1.2.3