Results 1 to 7 of 7

Thread: how can I know which object caused a specific event ?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2012
    Location
    Iran
    Posts
    34
    Thanks
    33
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default how can I know which object caused a specific event ?

    Suppose I have 3 sliders on my form, they all so similar jobs, but with a slight difference based on which category the belong .
    So one way is to create lets say 3 event handlers for their slider_move() event and then go on.
    the other way which I am interested in, is create one event handler, and make all of these 3 use that.

    so the signals must have the objects emitted as well, so that in the slot we can differentiate between multiple different objects

    How is this second one achieved ?
    how can I get the sender in this scenario?
    I checked the signal doesn't have a QObject parameter, and I don't want to re-implement the widgets each time I need such capability)?

    Thanks in advance
    Last edited by Hossein; 21st October 2015 at 07:41.

Similar Threads

  1. Pass event (QWheelEvent) to a specific widget
    By stefanadelbert in forum Qt Programming
    Replies: 2
    Last Post: 5th May 2021, 03:10
  2. How to know the signal which caused a qstate transition
    By ClintEastwood in forum Qt Programming
    Replies: 6
    Last Post: 24th April 2013, 15:27
  3. Style3sheet problem, QTreeView for specific object
    By hubbobubbo in forum Qt Programming
    Replies: 2
    Last Post: 11th February 2010, 21:15
  4. Signal to specific object slot
    By bunjee in forum Qt Programming
    Replies: 2
    Last Post: 27th December 2007, 15:51
  5. Crash caused by QVariant (mis)use
    By mclark in forum Newbie
    Replies: 2
    Last Post: 31st October 2006, 15:05

Tags for this Thread

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.