Results 1 to 4 of 4

Thread: action triggered no emit

  1. #1
    Join Date
    Mar 2012
    Location
    china
    Posts
    54
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default action triggered no emit

    allAssignMenu_->addMenu(menu);
    QAction* action = menu->menuAction();

    connect(action,SIGNAL(triggered()),this,SLOT(onTri ggered()));


    the slot onTriggered() won't be executed anyway,,

  2. #2
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: action triggered no emit

    the signal is triggered(bool) .. its having an argument bool ... just change it to
    connect(action,SIGNAL(triggered(bool)),this,SLOT(o nTri ggered()));

    if it not works .. in run time it will display some connect error ... just post that error ...
    "Behind every great fortune lies a crime" - Balzac

  3. #3
    Join Date
    Mar 2012
    Location
    china
    Posts
    54
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: action triggered no emit

    no,it don't work,,,!!!
    connect(action,SIGNAL(triggered(bool)),this,SLOT(o nTri ggered(bool)));

    the QAction is menuAction :
    QAction* action = menu->menuAction();

    not the action like that:
    QAction* action = new QAction;

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: action triggered no emit

    no,it don't work,,,!!!
    This is not a useful description of the problem and what you have done to try and track down the cause.

    Quote Originally Posted by wagmare
    if it not works .. in run time it will display some connect error ... just post that error ...
    Wagmare means the debug output or console window will probably contain a warning message about bad connections. Have you looked?

    If there is no warning then check the lifetime of the objects at each end of the connection. If either object is destroyed then the connect is lost.

Similar Threads

  1. QGraphicsItem paint not triggered
    By roband915 in forum Qt Programming
    Replies: 9
    Last Post: 31st March 2011, 10:06
  2. Replies: 3
    Last Post: 28th September 2010, 10:48
  3. find out which shortcut triggered action
    By qt_gotcha in forum Newbie
    Replies: 3
    Last Post: 23rd August 2010, 20:27
  4. Replies: 1
    Last Post: 11th April 2010, 14:21
  5. No action checked in an exclusive action group
    By SkripT in forum Qt Programming
    Replies: 12
    Last Post: 13th February 2006, 06:19

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.