Sending Arbitrary Arguments to a pyQt4 Slot

January 5, 2010

Okay, so you can’t send extra arguments through a slot when you connect it in pyQt4. What I mean by that is if you are connecting to a button’s clicked() signal it has zero arguments, so you don’t get to send anything to your slot.

This was a really big annoyance, I wanted to send arbitrary arguments defined at connect time. So I looked, and I looked and eventually, I found this treasure. Awesome.

And for usage…

It’s just what I needed, this is going into my stash of helpful hints.

Categories: Geek
Tags: , , ,


Leave A Comment

Your email will not be published.