[PyQt] signals and slots

Strato pyqt at p0w.org
Thu Jul 17 08:54:40 BST 2008


Hi Folks,

Thanks Russel for your answer, but I'm not able to figure out how my 
argument can be the correct one that way... Maybe I'm not as skilled as 
I need to realy understand hot this works...

hum seems that your style is in pure Qt, but I'm writing PyQt.

so, maybe an example will be the best way to explain my needs:

I have a popup menu, with entry generated by iteration, each entry is a 
submenu, and all sub menus are the same entry.

I can use QAction and its 'activated()' signal when I click on an item 
of a sub-menu, but I need to know which of the sub-menu is activated, to 
call my slot with the correct argument(s).

I need at lease one argument: an integer that corresponds to the object 
that was clicked, so I can determine from witch sub-menu the call is, or 
better, a string, like the name of the "sub-menu" item.

I hope you understand my idea, if not, and if you ar OK, we can discuss 
this outside of the list ? (to prevent flood with unusefull stuff in the 
list?)

Thanks!
Strato

Russell Valentine a écrit :
> Strato:
>
> Use a slot/function in the middle to call your slot with more 
> arguments with whatever arguments you want?
>
> activated() SIGNAL -> activateSlot()->slotWithArgs(whatever_args)
>
> You should be able to emit from activateSlot if you wanted to do it 
> that way as well. This seems to obvious to me so maybe this wasn't 
> what you were wanting.
>
>
> Russell Valentine
>
> Strato wrote:
>> Hi,
>>
>> is there a way to connect a signal that has no arguments, like the 
>> 'activated()' signal, to a slot with one or more arguments ?
>>
>> Regards,
>> Strato
>




More information about the PyQt mailing list