Workaround for broken handling of menus on OSX in Qt 5