On Thursday 10 March 2011 13:11:30 Mark Summerfield wrote:
> Hi,
> 
> The purpose of the @pyqtSignature decorator is to help the uic-generated
> file's setupUi() method's connectSlotsByName() call be able to correctly
> connect methods that are reimplementations of slots that have two or
> more overloads.

On PySide connectSlotsByName() only works with slots registered into 
metaobject, so you have to decorate your on_x_y methods with @Slot decorator, 
in the @Slot decorator you put the method signature, this also should work 
with PyQt.
 
> For example the QPushButton.clicked() signal has one overload that has
> no argument and another that has a bool (to indicate its toggle state).
>
> So whereas in PyQt I'd write:
> 
>     @pyqtSignature("")
>     def on_button_clicked(self):
>       # handle the non-toggle case
> 
>     @pyqtSignature("bool")
>     def on_button_clicked(self):
>       # handle the toggle case separately
> 
> how would I do it in PySide?
> 
> (I know my example doesn't make sense; it is just to illustrate the
> question.)
> 
> Thanks!

-- 
Hugo Parente Lima
INdT - Instituto Nokia de Tecnologia

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
PySide mailing list
[email protected]
http://lists.pyside.org/listinfo/pyside

Reply via email to