diff --git a/src/gui/DatabaseOpenDialog.cpp b/src/gui/DatabaseOpenDialog.cpp index 799e82963e..e1b9391d00 100644 --- a/src/gui/DatabaseOpenDialog.cpp +++ b/src/gui/DatabaseOpenDialog.cpp @@ -59,13 +59,24 @@ DatabaseOpenDialog::DatabaseOpenDialog(QWidget* parent) setLayout(layout); setMinimumWidth(700); - // set up Ctrl+PageUp and Ctrl+PageDown shortcuts to cycle tabs + // set up Ctrl+PageUp / Ctrl+PageDown and Ctrl+Tab / Ctrl+Shift+Tab shortcuts to cycle tabs + // Ctrl+Tab is broken on Mac, so use Alt (i.e. the Option key) - https://bugreports.qt.io/browse/QTBUG-8596 + auto dbTabModifier = Qt::CTRL; +#ifdef Q_OS_MACOS + dbTabModifier = Qt::ALT; +#endif auto* shortcut = new QShortcut(Qt::CTRL + Qt::Key_PageUp, this); shortcut->setContext(Qt::WidgetWithChildrenShortcut); connect(shortcut, &QShortcut::activated, this, [this]() { selectTabOffset(-1); }); + shortcut = new QShortcut(dbTabModifier + Qt::Key_Tab, this); + shortcut->setContext(Qt::WidgetWithChildrenShortcut); + connect(shortcut, &QShortcut::activated, this, [this]() { selectTabOffset(-1); }); shortcut = new QShortcut(Qt::CTRL + Qt::Key_PageDown, this); shortcut->setContext(Qt::WidgetWithChildrenShortcut); connect(shortcut, &QShortcut::activated, this, [this]() { selectTabOffset(1); }); + shortcut = new QShortcut(dbTabModifier + Qt::SHIFT + Qt::Key_Tab, this); + shortcut->setContext(Qt::WidgetWithChildrenShortcut); + connect(shortcut, &QShortcut::activated, this, [this]() { selectTabOffset(1); }); } void DatabaseOpenDialog::selectTabOffset(int offset)