Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[macOS] enable shortcuts #1085

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/app/medInria/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
#include <medSettingsManager.h>
#include <medStorage.h>

#ifdef Q_WS_MAC
extern void qt_set_sequence_auto_mnemonic(bool b);
#endif

void forceShow(medMainWindow& mainwindow )
{
//Idea and code taken from the OpenCOR project, Thanks Allan for the code!
Expand Down Expand Up @@ -68,6 +72,13 @@ void forceShow(medMainWindow& mainwindow )

int main(int argc,char* argv[])
{
// As described in QShortcut documentation, on macOS, shortcuts are disabled by default.
// To enable them we need to set qt_set_sequence_auto_mnemonic.
// On Linux & Windows the classic shortcut key is ALT.
#ifdef Q_WS_MAC
qt_set_sequence_auto_mnemonic(true);
#endif

// Setup openGL surface compatible with QVTKOpenGLNativeWidget required by medVtkView.
// We could have used "SurfaceFormat::setDefaultFormat(QVTKOpenGLNativeWidget::defaultFormat())"
// directly, but in order to avoid a link to VTK here, here is a copy of
Expand Down