Results 1 to 3 of 3

Thread: Problem with action triggers

  1. #1
    Join Date
    Mar 2009
    Posts
    72
    Thanks
    7
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Problem with action triggers

    Hi, I need to re-implement a one-level menu bar from a simple QWidget object. I have a list of registered actions with associated QPushButton instances. When the user clicks on a push button, the relative action is triggered.

    I want to implement a generic "triggered(QAction*)" signal in my custom menu bar class, so how can I find the exact triggered action when the user clicks on a menu button?

    I've tried a lot of solutions, without success:

    • connect(action, SIGNAL(triggered()), this, SLOT(onAction())) -> QAction doesn't have a "isTriggered" method or something similar to use in "onAction" function.
    • installEventFilter -> it doesn't work with actions...
    • Reimplement "actionEvent" method -> it isn't called when an action is triggered.

  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: Problem with action triggers

    J-P Nurmi

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

    zuck (7th April 2009)

  4. #3
    Join Date
    Mar 2009
    Posts
    72
    Thanks
    7
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Problem with action triggers

    Thanks!

Similar Threads

  1. QTreeView default drag action
    By onamatic in forum Qt Programming
    Replies: 2
    Last Post: 1st March 2010, 07:37
  2. Weird problem: multithread QT app kills my linux
    By Ishark in forum Qt Programming
    Replies: 2
    Last Post: 8th August 2008, 09:12
  3. Steps in solving a programming problem?
    By triperzonak in forum General Programming
    Replies: 8
    Last Post: 5th August 2008, 08:47
  4. Keyboard shortcuts problem.
    By Lemming in forum Qt Programming
    Replies: 4
    Last Post: 5th April 2006, 16:12
  5. No action checked in an exclusive action group
    By SkripT in forum Qt Programming
    Replies: 12
    Last Post: 13th February 2006, 06:19

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.