aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/libpyside/pyside.cpp
diff options
context:
space:
mode:
authorCristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2020-08-26 18:10:13 +0200
committerCristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2020-08-31 11:47:10 +0200
commit72aadf11a482acebf11d7658b7edb942d9995ff0 (patch)
tree968047a9b1f423cb7f0914c3aa080250bdba15ea /sources/pyside2/libpyside/pyside.cpp
parent9a37b64bbee7573578f63334b76a3eca533ea539 (diff)
Return QVariantList when using list as Signal argument
When determinating the type name for Signal types, we have special treatment for a couple of Python types like str, int, float, bool, etc, if the current type is none of those, we return a generic 'PyObject', which in most cases works, but not for specific interaction with WebChannel. Emiting one of the previous types works out of the box, but when using: ... = Signal(list) we get a message stating: > js: Uncaught TypeError: Cannot read property '0' of null meaning that list was not really passed correctly. The solution for this is to use: ... = Signal('QVariantList') but as a string, not type. Passing a string means that we will return the same type as string from the getTypeName function, so this patch adds a condition to treat Signal(list) as a Signal('QVariantList'). We were using this workaround for some bugs related to QtWebKit, so it was accepted as solution. Fixes: PYSIDE-981 Change-Id: I06720ca62426d51decc2ab08d380f7f967460788 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside2/libpyside/pyside.cpp')
0 files changed, 0 insertions, 0 deletions