aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/tests/pysidetest/containertest.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-11-05 09:14:53 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-11-05 11:49:54 +0100
commit391e47893c463da5b91024508b739e51ecdaaf45 (patch)
tree755dc6b346bd175eeb504cbdd917ec3ef954b43e /sources/pyside6/tests/pysidetest/containertest.cpp
parentd8cd97b050c68f352fef1df375c5c98f1daae029 (diff)
shiboken6: Handle PySets as function parameters
Python sets are iterable but not of sequence type. While the existing converter code from the templates uses iterators, the built-in check functions convertibleSequenceTypes()/checkSequenceTypes() assume a PySequence and would fail for PySets. Add new check functions convertibleIterableTypes()/checkIterableTypes() using iterators and use them for PySet. Add a test and a test for lists as a drive-by. [ChangeLog][PySide6] sets are now supported for functions taking a QSet. Pick-to: 6.2 Task-number: PYSIDE-174 Task-number: PYSIDE-1666 Change-Id: I883869162e7dfa9cd0e1669f941fb7864f0cf825 Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside6/tests/pysidetest/containertest.cpp')
-rw-r--r--sources/pyside6/tests/pysidetest/containertest.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/sources/pyside6/tests/pysidetest/containertest.cpp b/sources/pyside6/tests/pysidetest/containertest.cpp
index ccb90b12f..9debfa5b7 100644
--- a/sources/pyside6/tests/pysidetest/containertest.cpp
+++ b/sources/pyside6/tests/pysidetest/containertest.cpp
@@ -60,3 +60,23 @@ QMultiHash<int, QString> ContainerTest::passThroughMultiHash(const QMultiHash<in
{
return in;
}
+
+QList<int> ContainerTest::createList()
+{
+ return {1, 2};
+}
+
+QList<int> ContainerTest::passThroughList(const QList<int> &list)
+{
+ return list;
+}
+
+QSet<int> ContainerTest::createSet()
+{
+ return {1, 2};
+}
+
+QSet<int> ContainerTest::passThroughSet(const QSet<int> &set)
+{
+ return set;
+}