Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    QAction not triggered ?

    General and Desktop
    1
    1
    597
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      kegon last edited by

      Hi, I'm porting my software from Qt4 to Qt5.

      @ QToolBar *myToolBar = new QToolBar(this);
      QAction *myAction = new QAction(myIcon, tr("Options"), this);
      myToolBar->addAction(myAction);

      QMenu *myMenu = new QMenu(this);
      QAction *myMenuAction1 = myMenu->addAction("Task 1");
      connect(myMenuAction1, SIGNAL(triggered()), this, SLOT(goMenu1()));
      // .. add more menu items ..
      myAction->setMenu(myMenu); @

      I can't get the triggered() signal from the menu actions. Previously I was using the activated() signal (oops - that was Qt3Support).

      When I click (and release) on a menu item, the slot is not called.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post