[PyQt] Problem with class inheriting QDialog

Hans-Peter Jansen hpj at urpla.net
Mon Nov 23 15:25:41 GMT 2009


On Monday 23 November 2009, 15:56:24 dizou wrote:
> I've got this fixed, thank you. I had another typo I didn't catch.
>
> What I am trying to do is pass a parameter through the signal. I have a
> QTreeWidget object under my MainWindow class with a bunch of items in it.
> I want the signal to pass in the item I have selected when I click my
> button. How do I do that?

This won't work well with PyQt, since depending on selection policy, you may 
have a bunch of items selected. Your best bet is using the selection model 
in your signal handler to figure out, which items where selected, or if you 
insist, catch the button click, and emit a list of selected items with a 
second signal. BTW, check the new way of connecting to signals, it's cool!

Pete


More information about the PyQt mailing list