Related #6097
Qt ignores shortcut of actions in invisible toolbar, but not for actions
in a hidden menu action of menu bar, which is likely a Qt bug. The
desired behavior should be that of toolbar actions, so that actions
belong to different workbenches can have the same shortcut without
conflict.
This commit works around this inconsistency by ensuring only the active
actions are added in menu bar. In addition, all active actions will be
added to a zero sized child widget of the main window, which ensures the
shortcuts of these actions being active regardless whether the action is
in toolbar or menu bar, visible or not.
In particular this hides edit-mode sketcher toolbars when in non-edit-mode.
And hides non-edit-mode toolbar when in edit-mode.
It also hides the structure toolbar when in edit-mode (as it is completely deactivated)
* On lines where the variable type is obvious from inspection, avoid repeating the type using auto.
* When possible use a ranged for loop instead of begin() and end() iterators
When arranged vertically, the bar that allows the dragging of toolbars
can cause problems with the toolbar appearance. This adds a hidden
preference that controls whether the toolbars are movable.