diff options
author | Christian Tismer <tismer@stackless.com> | 2022-12-02 13:47:48 +0100 |
---|---|---|
committer | Christian Tismer <tismer@stackless.com> | 2022-12-13 11:26:19 +0100 |
commit | e20e29d1bd03f6ff9e57037d0a7f35bb59604f4e (patch) | |
tree | 3031f8f9b89879fd27950e63a346651338058ba1 /sources/shiboken6/generator/shiboken/cppgenerator.cpp | |
parent | d09302d50bf64afdf7eae0075134bb554c9d1166 (diff) |
__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 <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken6/generator/shiboken/cppgenerator.cpp')
-rw-r--r-- | sources/shiboken6/generator/shiboken/cppgenerator.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |