Merge #5995: fix(qt): tab switching via shortcuts doesn't work after 5986

c8742057ac fix(qt): tab switching via shortcuts doesn't work after 5986 (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  Looks like 3265b54a2f (#5986) broke it

  ## What was done?

  ## How Has This Been Tested?
  run dash-qt, try using shortcuts `cmd+1`, `cmd+2` etc. (on macos)

  ## Breaking Changes
  n/a

  ## Checklist:
  - [x] I have performed a self-review of my own code
  - [ ] I have commented my code, particularly in hard-to-understand areas
  - [ ] I have added or updated relevant unit/integration/functional/e2e tests
  - [ ] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  PastaPastaPasta:
    ACK c8742057ac
  kwvg:
    ACK c8742057ac

Tree-SHA512: 62a593ec804d75ff8aada0ef9ea90106adbf8cd11b202a6296086f55c2a4d2181e56dc8e56193a0ed49d94e55ee3236ab441ab477c8ca6d7b0c649dff987dbbc
This commit is contained in:
pasta 2024-04-26 14:50:32 -05:00
commit b1852e0a89
No known key found for this signature in database
GPG Key ID: 52527BEDABE87984

View File

@ -1612,14 +1612,14 @@ void updateButtonGroupShortcuts(QButtonGroup* buttonGroup)
return;
}
#ifdef Q_OS_MAC
auto modifier = Qt::CTRL;
auto modifier = "Ctrl";
#else
auto modifier = Qt::ALT;
auto modifier = "Alt";
#endif
int nKey = 0;
int nKey = 1;
for (auto button : buttonGroup->buttons()) {
if (button->isVisible()) {
button->setShortcut(QKeySequence(static_cast<int>(modifier) | static_cast<int>(Qt::Key_1) | nKey++));
button->setShortcut(QKeySequence(QString("%1+%2").arg(modifier).arg(nKey++)));
} else {
button->setShortcut(QKeySequence());
}