Skip to content
Permalink
Browse files

Simple fix for #5754 (Mac OS-specific). Better fix would be to make a…

… method that set all QAction additions to base menus (submenus ok) to QAction::NoRole. This would keep any new action from hijacking the Mac app's About or Preferences… menus.

See: http://doc.qt.nokia.com/4.7.1/qmenubar.html#qmenubar-on-mac-os-x
  • Loading branch information
dakcarto committed Jun 10, 2012
1 parent 769fd5e commit f01c6ad8c820a68e3d3050921b22781e100209d2
Showing with 13 additions and 0 deletions.
  1. +9 −0 src/app/qgisapp.cpp
  2. +1 −0 src/app/qgisapp.h
  3. +3 −0 src/ui/qgisapp.ui
@@ -928,6 +928,12 @@ void QgisApp::createActions()
connect( mActionCustomization, SIGNAL( triggered() ), this, SLOT( customize() ) );

#ifdef Q_WS_MAC
// copy of Options action that gets moved to app Preferences...
mActionOptionsMac = new QAction( mActionOptions->text(), this );
mActionOptionsMac->setMenuRole( QAction::NoRole );
mActionOptionsMac->setIcon( mActionOptions->icon() );
connect( mActionOptionsMac, SIGNAL( triggered() ), this, SLOT( options() ) );

// Window Menu Items

mActionWindowMinimize = new QAction( tr( "Minimize" ), this );
@@ -1158,6 +1164,9 @@ void QgisApp::createMenus()
}

#ifdef Q_WS_MAC
// copy back the Options action after assigned to app Preferences...
mSettingsMenu->addAction( mActionOptionsMac );

// Window Menu

mWindowMenu = menuBar()->addMenu( tr( "&Window" ) );
@@ -978,6 +978,7 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
// actions for menus and toolbars -----------------

#ifdef Q_WS_MAC
QAction *mActionOptionsMac;
QAction *mActionWindowMinimize;
QAction *mActionWindowZoom;
QAction *mActionWindowSeparator1;
@@ -1378,6 +1378,9 @@
<property name="text">
<string>Configure shortcuts...</string>
</property>
<property name="menuRole">
<enum>QAction::NoRole</enum>
</property>
</action>
<action name="mActionLocalHistogramStretch">
<property name="icon">

0 comments on commit f01c6ad

Please sign in to comment.
You can’t perform that action at this time.