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?

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
  • 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 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 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
      1
      • M mpergand
        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 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

        • Login

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