Hi all,

I have a question about the use of collection types in slot signatures. I
have a python object of the following kind:

class Test(QObject):

    @QtCore.Slot(list)
    def test(self, param):
        print 'param is', type(param), param

I've set an object of this kind into the script engine context, and try to
call it using the following:

val = engine.evaluate("test.test([1, 2, 3])")

The method is not called, and what I get as a result of calling toString on
'val' is "TypeError: incompatible type of argument(s) in call to test();
candidates were test(PyObject)".

When the slot signature is string or int, everything works properly. It
seems that the Array type isn't mapped into list or tuple in slot signature.
Yet when I call "engine.evaluate('[1, 2, 3]').toVariant()", I get a python
list.

What am I doing wrong here? Is there a reference somewhere about how
mappings between various types go?

Regards,
Jukka Välimaa
_______________________________________________
PySide mailing list
[email protected]
http://lists.openbossa.org/listinfo/pyside

Reply via email to