aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2018-07-27 15:18:18 +0200
committerCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2018-08-23 11:27:30 +0000
commitb5a574eaeeb6a4f30794e6012b96f05a3de49217 (patch)
tree3436a69e49a0f606c07a13cb6b0bbd414056b693
parent51d95a9e7b395fd15dbc4bfef40cdcb58139413c (diff)
Enforce pure PyDict to be associated to VariantMap
Classes that implement the dictionary protocol needs to be treated as PyObject and not plain dictionaries, then we can properly transform PyDicts to Variant Maps. The reason behind this is that it seems that the PyDict_Check is too permisive and allow objects that are not proper dictionaries. The default case by any other Sequence-like object will be a PyObject. Task-number: PYSIDE-82 Change-Id: I86e8a29e5b8740f69c9c6f315e9d337e599bd333 Reviewed-by: Christian Tismer <tismer@stackless.com>
-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 f50a2aaad..7e3d86d8a 100644
--- a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml
+++ b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml
@@ -422,7 +422,7 @@
converter.toCpp(pyIn, var.data());
%out = var;
</add-conversion>
- <add-conversion type="PyDict">
+ <add-conversion type="PyDict" check="PyDict_CheckExact(%in)">
QVariant ret = QVariant_convertToVariantMap(%in);
%out = ret.isValid() ? ret : QVariant::fromValue&lt;PySide::PyObjectWrapper&gt;(%in);
</add-conversion>