javascript - multiple arguments with PySide QtCore.Slot decorator -


how define multiple arguments? types supported? , why fail when combine decorator?

i couldn't find real documentation on went source -- pysideslot.cpp.

slot takes 2 keyword args, name (a string name slot) , result (a python type object or string naming qt type, used specify return type of function). if name isn't supplied, try read function you're decorating, careful: other decorators ruin name of function, if you're combining slot decorator may want explicitly specify name arg.

any positional arguments feed slot converted strings pyside::signal::gettypename , joined comma-separated string. become signature of slot , used routing calls.

for example, given decorator:

@qtcore.slot(int,str,result=float) def func(a,b):   assert len(b)==a; upload(b); return 2.5 

the pyside internals create call signature string of 'int,qstring' , resulttype string of 'double'.

i hope helps next person struggling debug slots.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -