PDA

View Full Version : Can i define signal/slot connection statement like this?



luffy27
4th November 2006, 06:34
i want to define bunch of connections. If i wrote like this, can it work?

for(int i = 0; i<10; i++)
connect( pb[i],SIGNAL(clicked ( ) ),this,SLOT ( pbpushed ( ) ) ) ;

munna
4th November 2006, 06:53
Yes, it will work.

If pb[i] is not a pointer then use




connect(&pb[i],SIGNAL(clicked ( ) ),this,SLOT ( pbpushed ( ) ) ) ;