Results 1 to 8 of 8

Thread: Double menu items on os x el capitan

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Double menu items on os x el capitan

    You could try creating your menu entry, waiting until the UI is shown (use a zero timer and a simple slot), and then removing/hiding your menu item leaving the OS X Auto-magic one. Yes, it would be an ugly hack.

    You can call Objective C functions from C++ if you jump through hoops
    http://stackoverflow.com/questions/1...-from-c-method

    I am not a Mac owner so I cannot be more specific.

  2. The following user says thank you to ChrisW67 for this useful post:

    rwhartzell (12th March 2016)

  3. #2
    Join Date
    Aug 2015
    Posts
    15
    Thanks
    3
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Double menu items on os x el capitan

    You're timer idea was simple enough and works fine except theres no short cuts. I guess that will work until Qt catches up with El Capitan. Thanks for the pointer.

    For anyone interested this is what i did because i still build and run on Yosemite.

    In the constructor...
    Qt Code:
    1. #if defined Q_OS_MAC
    2. if (QSysInfo::productVersion() == "10.11") {
    3. QTimer *timer = new QTimer(this);
    4. timer->setSingleShot(true);
    5. connect(timer, SIGNAL(timeout()), this, SLOT(elCapitanMenuHack()));
    6. timer->start(0);
    7. }
    8. #endif
    To copy to clipboard, switch view to plain text mode 

    And then a private slot...
    Qt Code:
    1. void MainWindow::elCapitanMenuHack() {
    2. ui->menu_View->removeAction(ui->action_enter_full_screen);
    3. ui->menu_View->removeAction(ui->action_exit_full_screen);
    4. }
    To copy to clipboard, switch view to plain text mode 

  4. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Double menu items on os x el capitan

    You might like the QTimer::singleShot() static function.

  5. The following user says thank you to ChrisW67 for this useful post:

    rwhartzell (12th March 2016)

  6. #4
    Join Date
    Aug 2015
    Posts
    15
    Thanks
    3
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Double menu items on os x el capitan

    Even better just needs to be set to a non zero value.

    Qt Code:
    1. #if defined Q_OS_MAC
    2. if (QSysInfo::productVersion() == "10.11") {
    3. QTimer::singleShot(1, this, SLOT(elCapitanMenuHack()));
    4. }
    5. #endif
    To copy to clipboard, switch view to plain text mode 

    Thanks again.

Similar Threads

  1. Implementing pinned menu items
    By wssddc in forum Qt Programming
    Replies: 1
    Last Post: 30th July 2013, 05:16
  2. Radio menu items in Designer
    By rbp in forum Qt Tools
    Replies: 0
    Last Post: 31st March 2009, 00:50
  3. designer not showing menu items ...
    By wagmare in forum Installation and Deployment
    Replies: 0
    Last Post: 24th February 2009, 10:26
  4. Want custom menu items, like graphics, but how?
    By rm in forum Qt Programming
    Replies: 1
    Last Post: 30th January 2008, 20:52
  5. Checkboxes in menu items
    By markcole in forum Qt Programming
    Replies: 2
    Last Post: 4th June 2007, 15:16

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.