aboutsummaryrefslogtreecommitdiffstats
path: root/sources
diff options
context:
space:
mode:
authorCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2018-07-30 15:27:27 +0200
committerCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2018-08-08 07:53:11 +0000
commitd55816ebe8e9b50c325d98dd70fbbaa35bf023c0 (patch)
tree39f51d01ac1dd6598fdf022561aebf630609fcf3 /sources
parentea3f493e526ec4052ac51bbe531bfbc48ea624e9 (diff)
Replace PySequence by PyList type
Most of the issues that we have in the past were because the broad scope of PySequence. Precisely, inside the QVariant conversion related to PySequence we just deal with 'lists', then having a Sequence is too broad and misleading. The problem related to this task number was due to the wrongly assumption that a Python class that implements the sequence protocol is a list, and it's not. With this change, we verify after the PyDict case if the element is a PyList, and the last default case will be PyObject. Thus, a custom class that implements the sequence protocol is nothing else than a PySequence, not a list. I'm uncertain if we really want to also have a case for PyTuple or any other Sequence-like type. Task-number: PYSIDE-726 Change-Id: I586ba725200acf910cf7b8c01002914984f06b5d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources')
-rw-r--r--sources/pyside2/PySide2/QtCore/typesystem_core_common.xml2
1 files changed, 1 insertions, 1 deletions
diff --git a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml
index 20cb508e8..29e28d929 100644
--- a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml
+++ b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml
@@ -426,7 +426,7 @@
QVariant ret = QVariant_convertToVariantMap(%in);
%out = ret.isValid() ? ret : QVariant::fromValue&lt;PySide::PyObjectWrapper&gt;(%in);
</add-conversion>
- <add-conversion type="PySequence">
+ <add-conversion type="PyList" check="PyList_Check(%in)">
QVariant ret = QVariant_convertToVariantList(%in);
%out = ret.isValid() ? ret : QVariant::fromValue&lt;PySide::PyObjectWrapper&gt;(%in);
</add-conversion>