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. OS X Unified toolbar Preferences not working

OS X Unified toolbar Preferences not working

Scheduled Pinned Locked Moved Unsolved General and Desktop
os xunified toolbar
3 Posts 2 Posters 1.5k 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.
  • Joel BodenmannJ Offline
    Joel BodenmannJ Offline
    Joel Bodenmann
    wrote on last edited by Joel Bodenmann
    #1

    I'm not an Mac user so please forgive me if I'm using wrong terminology or if I'm missing something very obvious.

    I have a Qt application which works very well on Windows and Linux. Now I'd like to add OS-X support (I want to provide a pre-build package/bundle).
    In my QMainWindow I have two QMenu with the following entries to open dialogs: File -> Preferences and Project -> Settings. The idea is that the Preferences are the application preferences themselves where the Settings are the settings of the project that is currently opened in the application.
    Apparently the unified toolbar recognizes the Preferences menu entry and moves it from the Files menu to a different menu entry (the application entry which is written in bold).
    My main problem is that the Settings menu entry which used to be in the Project menu is gone completely. Furthermore the Preferences menu entry is disabled. This is due to the fact that I disable the Project -> Settings menu entry if there's no project loaded in the application. This indicates that the unified toolbar also messes around with the Settings entry.

    I have absolutely no idea what causes this issue and whether it's supposed to be that way or whether it's a bug. I would appreciate any kind help to resolve this issue.

    Industrial process automation software: https://simulton.com
    Embedded Graphics & GUI library: https://ugfx.io

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      Wild guess here:
      Try setting Qt::AA_DontUseNativeMenuBar as Application Attribute

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      0
      • Joel BodenmannJ Offline
        Joel BodenmannJ Offline
        Joel Bodenmann
        wrote on last edited by Joel Bodenmann
        #3

        @VRonin Thank you for your suggestion!

        Interestingly that doesn't have any effect. The application still uses the unified menubar.
        I set the attribute like this in my main() before I construct and show the QMainWindow:

        QCoreApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, true);
        

        Interestingly I get the following debug messages in the application output pane when opening and closing the application when the attribute is set to true:

        Menu item is already in a menu, remove it from the other menu first before inserting
        Menu item is already in a menu, remove it from the other menu first before inserting
        Menu item is already in a menu, remove it from the other menu first before inserting
        Menu item is already in a menu, remove it from the other menu first before inserting
        Item to remove does not belong to this menu
        Item to remove does not belong to this menu
        Item to remove does not belong to this menu
        Item to remove does not belong to this menu
        

        I also tried QMainWindow::setUnifiedTitleAndToolBarOnMac() but without any success either. The application still uses the unified toolbar.

        I'm using Qt 5.6 on OS X 10.11.4 (El Capitan)

        Industrial process automation software: https://simulton.com
        Embedded Graphics & GUI library: https://ugfx.io

        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