Results 1 to 5 of 5

Thread: Signals and Slots

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Sep 2006
    Posts
    68
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Signals and Slots

    Can you be a little more specific about what exactly you want to do?

    Signals can be connected to slots using connect...

    Qt Code:
    1. connect( aButton, SIGNAL(clicked()), SLOT(myUsefulSlot()) );
    To copy to clipboard, switch view to plain text mode 

    In that example (from the docs) aButton is the object emitting the signal, clicked() is the name of the signal we are interested in, and myUsefulSignal() is the slot in our program we want it connected to.

    You define slots in your header with the slot keyword:

    Qt Code:
    1. public slots:
    2. void myUsefulSlot();
    To copy to clipboard, switch view to plain text mode 

    Hope that helps.

  2. The following user says thank you to December for this useful post:

    merry (22nd February 2007)

Similar Threads

  1. Signals and Slots question
    By Thoosle in forum Qt Programming
    Replies: 5
    Last Post: 5th December 2006, 00:24
  2. Nested signals and slots
    By vishva in forum Qt Programming
    Replies: 2
    Last Post: 18th August 2006, 09:47
  3. Signals and Slots in dll
    By ankurjain in forum Qt Programming
    Replies: 8
    Last Post: 29th March 2006, 08:12
  4. Order of signals and slots
    By Morea in forum Newbie
    Replies: 1
    Last Post: 26th February 2006, 22:09
  5. Problem with Signals and Slots
    By Kapil in forum Newbie
    Replies: 11
    Last Post: 15th February 2006, 11:35

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
  •  
Qt is a trademark of The Qt Company.