diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-02-21 16:16:09 +0100 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-02-22 16:17:27 +0100 |
| commit | 732be9c2d39ff85b16720821eb29a4ef8e87ab85 (patch) | |
| tree | c7ec188b63e3f7c5227f7d8a16327212ab23d9ec /sources/pyside6/tests/pysidetest/qvariant_test.py | |
| parent | c892b9299db5d240f2753a877b055f13b6239a63 (diff) | |
Fix conversion of QVariant<->QMatrix<n>x<m>
QMatrix<n>x<m> is a template specialization of
QGenericMatrix<n,m,float> which the type name of the QVariant
contains. To find the proper Shiboken converter for this, change the
name back.
As a drive-by, fix @snippet conversion-sbkobject to return a
PyObjectWrapper() with warning in cases where the QMetaType is valid
but no converter can be found.
Fixes: PYSIDE-2599
Pick-to: 6.6
Change-Id: I4f41dcbaa394fcc1732536c0b7a6569f694f3c45
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/pyside6/tests/pysidetest/qvariant_test.py')
| -rw-r--r-- | sources/pyside6/tests/pysidetest/qvariant_test.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sources/pyside6/tests/pysidetest/qvariant_test.py b/sources/pyside6/tests/pysidetest/qvariant_test.py index 79ac446e3..8b789b2c7 100644 --- a/sources/pyside6/tests/pysidetest/qvariant_test.py +++ b/sources/pyside6/tests/pysidetest/qvariant_test.py @@ -11,9 +11,9 @@ sys.path.append(os.fspath(Path(__file__).resolve().parents[1])) from init_paths import init_test_paths init_test_paths(True) -from testbinding import TestObject, TestQVariantEnum +from testbinding import TestObject, TestQVariantEnum, QVariantHolder from PySide6.QtCore import Qt, QKeyCombination -from PySide6.QtGui import QKeySequence, QAction +from PySide6.QtGui import QKeySequence, QAction, QMatrix3x3 from helper.usesqapplication import UsesQApplication @@ -64,6 +64,15 @@ class QVariantTest(UsesQApplication): # check toInt() conversion for IntEnum self.assertEqual(PyTestQVariantEnum.getNumberFromQVarEnum(Qt.GestureType.TapGesture), 1) + def testMatrixTemplates(self): + holder = QVariantHolder() + matrix = QMatrix3x3() + matrix.setToIdentity() + holder.setValue(matrix) + returned = holder.value() + self.assertTrue(returned, QMatrix3x3) + self.assertTrue(returned.isIdentity()) + if __name__ == '__main__': unittest.main() |
