Results 1 to 2 of 2

Thread: Can i define signal/slot connection statement like this?

  1. #1
    Join Date
    Nov 2006
    Posts
    58
    Thanks
    1
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Can i define signal/slot connection statement like this?

    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 ( ) ) ) ;

  2. #2
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Can i define signal/slot connection statement like this?

    Yes, it will work.

    If pb[i] is not a pointer then use

    Qt Code:
    1. connect(&pb[i],SIGNAL(clicked ( ) ),this,SLOT ( pbpushed ( ) ) ) ;
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. queued signal/slot connection with QList<int>
    By smalls in forum Qt Programming
    Replies: 2
    Last Post: 7th February 2006, 14:32

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.