Results 1 to 5 of 5

Thread: [SOLVED] Question about signals sources.

  1. #1
    Join Date
    Dec 2006
    Posts
    160
    Thanks
    33
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default [SOLVED] Question about signals sources.

    Hello again

    I have a question wich is not a problem for me, i just want to know in advance if i can do it:
    Is it possible to get, from a signal, the "originator" of the signal?
    For instance, writing a class wich 10 buttons, only one slot to handle all of the 10 different signals (Connect will occurs 10 times, but always with the same slot), and then in this method a simple switch on the originator's adress compared to the adresses of the known 10 buttons?

    Thanks!
    Pierre.

    P.S.: I know i'm asking quite a lot of questions since i suscribed here, well the point is i'm discovering QT (Began 4 days ago) and i really want an overview of it before putting myself into troubles on later code writing
    Last edited by hickscorp; 8th December 2006 at 14:08.

  2. #2
    Join Date
    May 2006
    Posts
    55
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Question about signals sources.

    Hi

    QObject::sender() should help you. Along with its recommandations in the doc.

    Hth

  3. The following user says thank you to lauranger for this useful post:

    hickscorp (8th December 2006)

  4. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Question about signals sources.

    Also try QSignalMapper.

  5. The following user says thank you to jacek for this useful post:

    hickscorp (8th December 2006)

  6. #4
    Join Date
    Dec 2006
    Posts
    160
    Thanks
    33
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Question about signals sources.

    Thanks a lot, i'll take a look at those as soon as possible

    Pierre.

  7. #5
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Question about signals sources.

    For buttons and actions there is also QButtonGroup and QActionGroup, respectively..
    J-P Nurmi

Similar Threads

  1. Signals and Slots question
    By Thoosle in forum Qt Programming
    Replies: 5
    Last Post: 5th December 2006, 00:24
  2. QThread exit()/quit() question
    By TheKedge in forum Qt Programming
    Replies: 1
    Last Post: 28th August 2006, 14:38
  3. Tracing signals.
    By johnny_sparx in forum Qt Programming
    Replies: 11
    Last Post: 13th April 2006, 23:18
  4. Signals and Slots in dll
    By ankurjain in forum Qt Programming
    Replies: 8
    Last Post: 29th March 2006, 08:12
  5. KDE Signals
    By chombium in forum KDE Forum
    Replies: 1
    Last Post: 25th January 2006, 18:45

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.