From c0beb9f29f36ea3bc8be26675a05253cc5584fe4 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 19 Oct 2021 16:54:01 +0200 Subject: shiboken6: Implement opaque containers for getters (non-const) Extract helpers from the opaque containers generation for fields and use them for function returns if the type is modified accordingly. [ChangeLog][shiboken6] Getters returning containers by reference can now be modified to return an opaque container by modifying the return type accordingly. Pick-to: 6.2 Task-number: PYSIDE-1605 Change-Id: Ieaf5eb92d248d3a23e511222e5f61823e85540c0 Reviewed-by: Christian Tismer Reviewed-by: Cristian Maureira-Fredes --- sources/shiboken6/tests/minimalbinding/listuser_test.py | 6 ++++++ sources/shiboken6/tests/minimalbinding/typesystem_minimal.xml | 5 +++++ 2 files changed, 11 insertions(+) (limited to 'sources/shiboken6/tests/minimalbinding') diff --git a/sources/shiboken6/tests/minimalbinding/listuser_test.py b/sources/shiboken6/tests/minimalbinding/listuser_test.py index 1a11ccfbf..7bb65d359 100644 --- a/sources/shiboken6/tests/minimalbinding/listuser_test.py +++ b/sources/shiboken6/tests/minimalbinding/listuser_test.py @@ -345,6 +345,12 @@ class ListOfIntListConversionTest(unittest.TestCase): self.assertEqual(len(lu.m_stdIntList), 3) self.assertEqual(lu.m_stdIntList[2], 5) + # Access list via getter + l = lu.getIntList() + l.append(6) + self.assertEqual(len(lu.m_stdIntList), 4) + self.assertEqual(lu.m_stdIntList[3], 6) + if __name__ == '__main__': unittest.main() diff --git a/sources/shiboken6/tests/minimalbinding/typesystem_minimal.xml b/sources/shiboken6/tests/minimalbinding/typesystem_minimal.xml index 40973fa5f..94ec4a649 100644 --- a/sources/shiboken6/tests/minimalbinding/typesystem_minimal.xml +++ b/sources/shiboken6/tests/minimalbinding/typesystem_minimal.xml @@ -48,6 +48,11 @@ + + + + + -- cgit v1.2.3