diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-06-08 08:47:54 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-06-09 13:02:06 +0000 |
commit | 91d8597a5d5f7b73f631da5c4d498e94ad7ce506 (patch) | |
tree | 301d03cc2907568fec9a904c97d1583eb82cc7f1 /sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml | |
parent | 86422715110dc067a316ce4b8d9cbc37b52835c3 (diff) |
shiboken6: Fix increment/decrement operators
For classes that have increment/decrement operators
(++/--), shiboken6 generated operators +=/-= ( __iadd__/__isub__)
by calling them n times. This was mainly intended for iterators.
However, when both operator++/-- and operator+=/-= were present (as
introduced by qtdeclarative/f8f31dd0e1f9425ba272691c79e719ebc4bcfb94
for QJSPrimitiveValue), duplicate code and errors were generated.
This requires filtering of the operator functions.
Introduce a separate function type for increment/decrement operators
and remove them if operators +=/-= were found. Also, when
both prefix and postfix version of the increment/decrement operators
are found, remove one.
Extend existing class IntWrapper from libsample for testing.
Add explanatory comment and use prefix increment.
Change-Id: I0f8a0c79a6f74974ba327d21f35fff74962ffd3a
Reviewed-by: Christian Tismer <tismer@stackless.com>
(cherry picked from commit 783720fdb308a686610b4f70e839930b60970362)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml')
-rw-r--r-- | sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml b/sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml index c54a7e5d7..ce546d9cc 100644 --- a/sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml +++ b/sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml @@ -1424,12 +1424,6 @@ </extra-includes> <value-type name="iterator" > <include file-name="QTextFrame" location="global"/> - <!-- ### These operators where removed because they don't make sense in Python. - Instead iterator methods (__iter__, next) should be implemented. - See bug 688 --> - <modify-function signature="operator++()" remove="all"/> - <modify-function signature="operator--()" remove="all"/> - <!-- ### --> <add-function signature="__iter__()" return-type="PyObject*"> <inject-code class="target" position="beginning"> <insert-template name="__iter__"/> |