aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2021-07-08 16:14:11 +0200
committerChristian Tismer <tismer@stackless.com>2021-07-22 09:51:23 +0200
commit7f8ffe2620a6d31fb0b5aa3b78d9a7eca8eaff65 (patch)
tree3b11d08f7f593d8931b8bad2b04b65ead26d0e6e /sources/pyside6/PySide6/QtCore/typesystem_core_common.xml
parentea9b082947933a7d381e177292a36dc6c5b0574c (diff)
PySide: fix QItemSelection default and QItemSelection.__add__
QItemSelection with no argument should create an empty selector. This worked in Qt5. In Qt6, everything works but the empty argument. Without further analysis, this might be related to the new [default] tag found in the Qt6 QItemSelection documentation? Fixing this bug leads directly to the add operator, which returns a list instead of a combined QItemSelection. Fixed by removing `operator+(list<QItemSelectionRange>)` and re-adding it with QItemSelection Unrelated, occurred during bug hunting. Task-number: PYSIDE-535 Change-Id: Ie5b881659e54fc0eebc8c9903df6e14eb2788565 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 16429c860888578b5bda7fd75437dd1f6a79b331)
Diffstat (limited to 'sources/pyside6/PySide6/QtCore/typesystem_core_common.xml')
-rw-r--r--sources/pyside6/PySide6/QtCore/typesystem_core_common.xml9
1 files changed, 9 insertions, 0 deletions
diff --git a/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml b/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml
index 16d739056..e4a48bb25 100644
--- a/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml
+++ b/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml
@@ -1541,6 +1541,15 @@
not see due to the TMP expression of the return type. -->
<add-function signature="operator==(const QItemSelection&amp;)" return-type="bool"/>
<add-function signature="operator!=(const QItemSelection&amp;)" return-type="bool"/>
+ <!-- For some reason, the empty selection is not seen. Maybe related to the new [default]
+ tag in Qt6? -->
+ <declare-function signature="QItemSelection()" return-type="QItemSelection" />
+ <!-- The __add__ function creates a result list, instead of using the inherited type.
+ Solved for now by removing and re-adding with the correct type. -->
+ <modify-function signature="operator+(QList&lt;QItemSelectionRange&gt;)const" remove="all" />
+ <add-function signature="operator+(QItemSelection)" return-type="QItemSelection">
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qitemselection-add"/>
+ </add-function>
</value-type>
<object-type name="QItemSelectionModel">