Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QAction not triggered ?
Qt 6.11 is out! See what's new in the release blog

QAction not triggered ?

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 788 Views 1 Watching
  • 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 Offline
    K Offline
    kegon
    wrote on last edited by
    #1

    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
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved