Thanks, but that's not quite what I'm looking for. I have slot functions
that take variable argument lists, and I'd like to be able to connect
signals to these. For example:
def slotFn(arg1, arg2, *args):
pass
class Obj(QObject):
sig = QSignal(...)
def emitSig(self):
self.sig.emit(arg1, arg2, *[args])
obj = Obj()
obj.sig.connect(slotFn)
The best I can come up with is to send a single list through the signal, as
you suggest, and then unpack the list with a wrapper function:
obj.sig.connect(lambda args: slotFn(*args))
.. but this is a little messy, and if I remember correctly, introducing
lambda functions brings up some other problems (
http://developer.qt.nokia.com/wiki/Differences_Between_PySide_and_PyQt)
With old-style signals/slots, this was trivial. I might write up a PSEP for
it.. can anyone think of a reason it might not work?
Luke
On Thu, Mar 3, 2011 at 21:43, MuSheng <[email protected]> wrote:
> Maybe the url will help you.
>
>
> http://stackoverflow.com/questions/2823112/communication-between-threads-in-pyside
>
>
>
> On 2011-03-04 08:12, Luke Campagnola wrote:
>
> Hello,
> In my PyQt app, I frequently use variable-length argument lists with my
> signals, like this:
> self.emit(QtCore.QObject.SIGNAL('signalName'), *args)
>
> Is there any way to accomplish the same thing in PySide using new-style
> signals?
>
> Thanks!
>
>
> _______________________________________________
> PySide mailing
> [email protected]http://lists.pyside.org/listinfo/pyside
>
>
>
_______________________________________________
PySide mailing list
[email protected]
http://lists.pyside.org/listinfo/pyside