Results 1 to 2 of 2

Thread: QMenu mac

  1. #1
    Join Date
    Apr 2011
    Posts
    132
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QMenu mac

    Any idea how to add an QAction into mac menubar ? Mac has default first menu named as name of the application, it appears on menubar as first on left. I want to add an action there but the code below seems not working.

    Qt Code:
    1. QAction *b1 = new QAction(tr("Check for Updates"), this);
    2. _ui->menubar->addAction(b1);
    3. connect(b1, SIGNAL(triggered()), this, SLOT(checkForUpdates()));
    To copy to clipboard, switch view to plain text mode 

    I have created default mainwindow.ui form.

    Any ideas ?

    Thanks for help.

  2. #2
    Join Date
    Aug 2011
    Posts
    44
    Thanked 13 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows Symbian S60

    Default Re: QMenu mac

    As to action to put under "AppName": try to set action's menu role with QAction::ApplicationSpecificRole value before adding to the bar.
    For instance:
    b1->setMenuRole( QAction::ApplicationSpecificRole );

Similar Threads

  1. QMENU and delay
    By Parhs in forum Qt Programming
    Replies: 1
    Last Post: 21st April 2011, 09:14
  2. Qmenu
    By deeee in forum Qt Programming
    Replies: 3
    Last Post: 27th May 2010, 01:27
  3. QMenu
    By khcbabu in forum Qt Programming
    Replies: 2
    Last Post: 22nd October 2008, 14:08
  4. QMenu
    By toki83 in forum Qt Programming
    Replies: 2
    Last Post: 22nd March 2008, 11:17
  5. QMenu Help pls
    By munna in forum Newbie
    Replies: 2
    Last Post: 19th March 2006, 15:36

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.