Results 1 to 3 of 3

Thread: menu actions calling a single slot

  1. #1
    Join Date
    Feb 2006
    Posts
    26
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt3
    Platforms
    MacOS X Windows

    Default menu actions calling a single slot

    Hi,

    I have a menu with actions 1 through 10. When activated, I want each one to call the same slot, but with a parameter of its item number in the menu.

    This was easy in qt3 with connectItem, but I can't see how to do this in Qt4.

    Any suggestions?

    Thanks!

    Jay

  2. #2
    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: menu actions calling a single slot

    QActionGroup or QSignalMapper does the trick.
    J-P Nurmi

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

    jayw710 (28th June 2007)

  4. #3
    Join Date
    Feb 2006
    Posts
    26
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt3
    Platforms
    MacOS X Windows

    Default Re: menu actions calling a single slot

    Quote Originally Posted by jpn View Post
    QActionGroup or QSignalMapper does the trick.
    Yes, QSignalMapper did the trick, thanks!
    Jay

Similar Threads

  1. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13

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.