Repository: spyder-ide/spyder

Issue:
View and Help application menus are not being display in master.
<!--- **PLEASE READ:** When submitting here, please ensure you've completed the following checklist and checked the boxes to confirm. Issue reports without it may be closed. Thanks! --->

### Issue Report Checklist

* [ ] Searched the [issues page](https://github.com/spyder-ide/spyder/issues?q=is%3Aissue) for similar reports
* [ ] Read the relevant sections of the [Spyder Troubleshooting Guide](https://github.com/spyder-ide/spyder/wiki/Troubleshooting-Guide-and-FAQ) and followed its advice
* [ ] Reproduced the issue after updating with ``conda update spyder`` (or ``pip``, if not using Anaconda)
* [ ] Could not reproduce inside ``jupyter qtconsole`` (if console-related)
* [ ] Tried basic troubleshooting (if a bug/error)
    * [ ] Restarted Spyder
    * [ ] Reset preferences with ``spyder --reset``
    * [ ] Reinstalled the latest version of [Anaconda](https://www.anaconda.com/download/)
    * [ ] Tried the other applicable steps from the Troubleshooting Guide
* [ ] Completed the **Problem Description**, **Steps to Reproduce** and **Version** sections below


## Problem Description

The View and Help application menus are not being display in master.

<img width="1280" alt="Screenshot 2021-01-18 at 4 37 55 PM" src="https://user-images.githubusercontent.com/18587879/104964939-86284d80-59ab-11eb-8187-cdcf8027cb83.png">


### What steps reproduce the problem?

1. 
2. 
3. 

### What is the expected output? What do you see instead?



### Paste Traceback/Error Below (if applicable)
<!--- Copy from error dialog or View > Panes > Internal Console --->

```python-traceback

PASTE TRACEBACK HERE

```

## Versions
<!--- You can get this information from Help > About Spyder...
or (if Spyder won't launch) the "conda list" command
from the Anaconda Prompt/Terminal/command line. --->

* Spyder version: master
* Python version: 
* Qt version: 
* PyQt version: 
* Operating System name/version: 

### Dependencies
<!--- Please go to the menu entry Help > Dependencies,
press the Copy to clipboard button and paste below --->

```
PASTE DEPENDENCIES HERE
```



Discussion:
I confirm I'm not seeing this on Linux, so it seems to happen only on Mac.
Note: https://stackoverflow.com/questions/26004830/qt-change-application-qmenubar-contents-on-mac-os-x (seems like the menu needs to have at least one action to be visible)

Resolving patch:
diff --git a/spyder/api/widgets/menus.py b/spyder/api/widgets/menus.py
--- a/spyder/api/widgets/menus.py
+++ b/spyder/api/widgets/menus.py
@@ -8,8 +8,11 @@
 Spyder API menu widgets.
 """
 
+# Standard library imports
+import sys
+
 # Third party imports
-from qtpy.QtWidgets import QMenu
+from qtpy.QtWidgets import QAction, QMenu
 
 # Local imports
 from spyder.utils.qthelpers import add_actions
@@ -52,6 +55,11 @@ def __init__(self, parent=None, title=None):
             super().__init__(title, parent)
 
         self.MENUS.append((parent, title, self))
+        if sys.platform == 'darwin':
+            # Needed to enable the dynamic population of actions in menus
+            # in the aboutToShow signal
+            # See spyder-ide/spyder#14612
+            self.addAction(QAction(self))
         self.aboutToShow.connect(self._render)
 
     def add_action(self, action, section=None, before=None,
diff --git a/spyder/plugins/mainmenu/plugin.py b/spyder/plugins/mainmenu/plugin.py
--- a/spyder/plugins/mainmenu/plugin.py
+++ b/spyder/plugins/mainmenu/plugin.py
@@ -178,15 +178,16 @@ def _setup_menus(self):
         """Setup menus."""
         # Show and hide shortcuts and icons in menus for macOS
         if sys.platform == 'darwin':
-            for menu in self._APPLICATION_MENUS:
+            for menu_id in self._APPLICATION_MENUS:
+                menu = self._APPLICATION_MENUS[menu_id]
                 if menu is not None:
                     menu.aboutToShow.connect(
-                        lambda menu=menu: self.show_shortcuts(menu))
+                        lambda menu=menu: self._show_shortcuts(menu))
                     menu.aboutToHide.connect(
-                        lambda menu=menu: self.hide_shortcuts(menu))
+                        lambda menu=menu: self._hide_shortcuts(menu))
                     menu.aboutToShow.connect(
                         lambda menu=menu: set_menu_icons(menu, False))
-                    menu.aboutToShow.connect(self.hide_options_menus)
+                    menu.aboutToShow.connect(self._hide_options_menus)
         self._populate_help_menu()
 
     # --- Public API


Test patch: