aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build_history/blacklist.txt3
-rw-r--r--sources/pyside6/PySide6/QtCore/typesystem_core_common.xml9
-rw-r--r--sources/pyside6/PySide6/glue/qtcore.cpp5
3 files changed, 14 insertions, 3 deletions
diff --git a/build_history/blacklist.txt b/build_history/blacklist.txt
index f7fb0c387..7786fe989 100644
--- a/build_history/blacklist.txt
+++ b/build_history/blacklist.txt
@@ -37,9 +37,6 @@
# Open GL functions failures on macOS (2/2020)
[registry::existence_test]
darwin
-# QItemSelection::operator+() degenerates to list<QItemSelectionRange> for which added operator==() does not work
-[QtWidgets::bug_785]
- qt6
[QtCore::bug_686]
linux ci
[QtCore::qthread_signal_test]
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">
diff --git a/sources/pyside6/PySide6/glue/qtcore.cpp b/sources/pyside6/PySide6/glue/qtcore.cpp
index 9bc516f08..8228e3c19 100644
--- a/sources/pyside6/PySide6/glue/qtcore.cpp
+++ b/sources/pyside6/PySide6/glue/qtcore.cpp
@@ -1704,6 +1704,11 @@ PyMem_Free(temp);
%out = %OUTTYPE();
// @snippet conversion-pynone
+// @snippet qitemselection-add
+auto res = (*%CPPSELF) + cppArg0;
+%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](res);
+// @snippet qitemselection-add
+
// @snippet conversion-pystring-char
char c = %CONVERTTOCPP[char](%in);
%out = %OUTTYPE(c);