Hi Jukka Välimaa,

I created this small example, and this works fine for me.

---------------------------------------------------------------------------------------
from PySide.QtCore import QObject, Slot

class Test(QObject):
    @Slot(list)
    def test(self, param):
        print 'param is', type(param), param

o = Test()
o.test([1, 2, 3])

---------------------------------------------------------------------------------------


Can you try reproduce your problem in a complete example. This will be
easier to help you, with this problem.






2010/12/9 Jukka Välimaa <[email protected]>:
> 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):
>
>    �[email protected](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
>
>



-- 
Renato Araujo Oliveira Filho
Instituto Nokia de Tecnologia - INdT
Mobile: +55 (81) 8704-2144
_______________________________________________
PySide mailing list
[email protected]
http://lists.openbossa.org/listinfo/pyside

Reply via email to