Results 1 to 8 of 8

Thread: QSignalMapper One single Object

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2009
    Posts
    56
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    6

    Default QSignalMapper One single Object

    Hi there,

    Is it possible to connect different signals form the same object to a signalmapper, and still know wich signal is triggered? or there is a way to connect signal to a single slot wit a define input.

    first case(did not work):
    Qt Code:
    1. //signal1 and signal2 are cons char *
    2. //firs case:
    3. connect(object,signal1, sMapper,SLOT(map()));
    4. sMapper->setMapping(object, signal1);
    5. connect(object,signal2, sMapper,SLOT(map()));
    6. sMapper->setMapping(object, signal2);
    7.  
    8. connect(sMapper, SIGNAL(mapped(QString)), this, SLOT(triggered(QString)));
    9.  
    10. //second case(What i would like to do):
    11. //assign a predefined value to the signal.
    12.  
    13. connect(object,signal1, this,SLOT(triggered(=signal1)));
    14. connect(object,signal2, this,SLOT(triggered(=signal2));
    To copy to clipboard, switch view to plain text mode 

    thanks for the answer
    Last edited by wysota; 12th March 2011 at 20:05.

Similar Threads

  1. QSignalMapper
    By axisdj in forum Newbie
    Replies: 6
    Last Post: 16th September 2010, 02:52
  2. QSignalMapper and argument problems
    By harmodrew in forum Newbie
    Replies: 14
    Last Post: 7th August 2010, 20:20
  3. help with QSignalMapper and actions
    By andreime in forum Newbie
    Replies: 1
    Last Post: 9th August 2009, 19:24
  4. ? about QSignalMapper
    By JimDaniel in forum Qt Programming
    Replies: 1
    Last Post: 13th January 2008, 22:21
  5. QSignalMapper question: SIGNAL 2 int's
    By vonCZ in forum Newbie
    Replies: 5
    Last Post: 20th July 2007, 11:02

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.