Results 1 to 15 of 15

Thread: is there anyway to know witch object sends a signal to a slot?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2015
    Posts
    128
    Thanks
    70
    Qt products
    Qt5
    Platforms
    Windows

    Default is there anyway to know witch object sends a signal to a slot?

    Hi

    There are two objects of a class(obj1 , obj2). These objects use same signal and slot like this:
    Qt Code:
    1. connect(obj1, SIGNAL(sgnl()), SLOT(slt()));
    2. connect(obj2, SIGNAL(sgnl()), SLOT(slt()));
    3.  
    4. //sgnl and slt are created by myself.
    To copy to clipboard, switch view to plain text mode 

    I need when sgnl() signal is send from obj1, the slt() slot can know this and use obj1 address and also when sgnl() signal is send from obj2, the slt() slot can know this and use obj2 address.

    Thanks for any helps.
    Last edited by Alex22; 3rd December 2015 at 12:49.

Similar Threads

  1. Replies: 1
    Last Post: 14th August 2014, 17:08
  2. SIGNAL/SLOT - Object scope?
    By StarShaper in forum Qt Programming
    Replies: 2
    Last Post: 19th February 2012, 13:35
  3. Replies: 3
    Last Post: 3rd May 2009, 14:15
  4. Manually send signal to slot
    By donmorr in forum Qt Programming
    Replies: 1
    Last Post: 29th May 2006, 15:03
  5. Signal-Slot, object instances
    By ct in forum Qt Programming
    Replies: 3
    Last Post: 16th February 2006, 19:08

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.