Code review comment for lp:~daggerstab/stellarium/oculars-gui-improvement

Revision history for this message
Bogdan Marinov (daggerstab) wrote :

OK, according to Alexander Wolf, the latest revision enables the shortcuts on Mac. Apparently, they are disabled by default because they don't fit in Apple's design philosophy or something.

More info:
http://doc.qt.nokia.com/stable/qshortcut.html#details
http://doc.qt.nokia.com/stable/qtglobal.html#qt_set_sequence_auto_mnemonic

Unfortunately, this means that the underlines indicating the shortcuts are simply not displayed on a Mac and, by default, on Windows 7 (though this can be changed in the user settings). And this kills the whole idea. :(

Something that needs to be experimented with: using QActions like in your orignal implementation, but with setting their shortcut context to Qt::WidgetShortcut or some of the other values:
http://doc.qt.nokia.com/stable/qaction.html#shortcutContext-prop

QMenu::addAction() returns a pointer to the action, so calling setShortcut() for each menu item will be easy.

I don't have time to experiment with this right now, so I'm inclined to merge the code in its current implementation and make the adjustment later.

« Back to merge proposal