[PySide] One signal name, different arguments.

Alexey Vihorev vihorev at gmail.com
Sat Feb 2 11:18:39 CET 2013


Thanks, it works!

-----Original Message-----
From: Andy Kittner [mailto:andy.kittner at gmail.com] 
Sent: Saturday, February 02, 2013 11:00 AM
To: Alexey Vihorev
Cc: pyside at qt-project.org
Subject: Re: [PySide] One signal name, different arguments.

On Sat, Feb 02, 2013 at 10:27:43AM +0200, Alexey Vihorev wrote:
>Hi all.
>
>I'm trying to use QCompleter class, and the problem is it has two 
>signals with the same name but different arguments:
>
>
>
>void QCompleter::activated ( const QString 
><http://qt-project.org/doc/qt-4.8/qstring.html>  & text ) [signal]
>
>void QCompleter::activated ( const QModelIndex 
><http://qt-project.org/doc/qt-4.8/qmodelindex.html>  & index ) [signal]
>
>
>
>If I use it like completer.activated.connect(my_func)then my_func will 
>get the string argument, but I need QModelIndex. Decorating my_func 
>with @QtCore.Slot(QtCore.QModelIndex)did not help. Any thoughts?
IIRC you can add the type signature when connecting the signal like
this:

   completer.activated[QtCore.QModelIndex].connect(myfunc)

Regards,
Andy




More information about the PySide mailing list