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. How to add menu items under application menu on macOS?
Forum Updated to NodeBB v4.3 + New Features

How to add menu items under application menu on macOS?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 1.2k Views 2 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.
  • P Offline
    P Offline
    patrickkidd
    wrote on 21 Jul 2018, 00:26 last edited by
    #1

    I am trying to figure out how to add QAction's to the application menu, the one automatically created with the app's name, on macOS. The application automatically adds quit and preferences actions, but I want to add another one to show my in-app purchases widget.

    Any idea how to do this?

    Thanks!
    -Patrick

    https://alaskafamilysystems.com/

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mpergand
      wrote on 21 Jul 2018, 00:58 last edited by
      #2
      QAction::ApplicationSpecificRole
      This action should be put in the application menu with an application specific role
      

      Create the action with this menuRole:

      action=menu->addAction(tr("Purchase..."));
      action->setMenuRole(QAction::ApplicationSpecificRole);
      
      P 1 Reply Last reply 21 Jul 2018, 01:47
      1
      • M mpergand
        21 Jul 2018, 00:58
        QAction::ApplicationSpecificRole
        This action should be put in the application menu with an application specific role
        

        Create the action with this menuRole:

        action=menu->addAction(tr("Purchase..."));
        action->setMenuRole(QAction::ApplicationSpecificRole);
        
        P Offline
        P Offline
        patrickkidd
        wrote on 21 Jul 2018, 01:47 last edited by
        #3

        @mpergand said in How to add menu items under application menu on macOS?:

        QAction::ApplicationSpecificRole
        This action should be put in the application menu with an application specific role
        

        Create the action with this menuRole:

        action=menu->addAction(tr("Purchase..."));
        action->setMenuRole(QAction::ApplicationSpecificRole);
        

        Perfect! Thank you....

        https://alaskafamilysystems.com/

        1 Reply Last reply
        0

        1/3

        21 Jul 2018, 00:26

        • Login

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