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
Post a Comment