Mercurial > hg > svapp
comparison framework/MainWindowBase.cpp @ 399:81e41a430b58
Handle keyboard shortcuts with Shift modifier in the same way as those with no modifier
author | Chris Cannam |
---|---|
date | Mon, 01 Sep 2014 13:37:22 +0100 |
parents | 2f54917f1599 |
children | eb84b06301da |
comparison
equal
deleted
inserted
replaced
397:f747be6743ab | 399:81e41a430b58 |
---|---|
366 break; | 366 break; |
367 } | 367 } |
368 } | 368 } |
369 if (hasButton) continue; | 369 if (hasButton) continue; |
370 QKeySequence sc = a->shortcut(); | 370 QKeySequence sc = a->shortcut(); |
371 if (sc.count() == 1 && !(sc[0] & Qt::KeyboardModifierMask)) { | 371 |
372 // Note that the set of "single-key shortcuts" that aren't | |
373 // working and that we need to handle here includes those | |
374 // with the Shift modifier mask as well as those with no | |
375 // modifier at all | |
376 if (sc.count() == 1 && | |
377 ((sc[0] & Qt::KeyboardModifierMask) == Qt::NoModifier || | |
378 (sc[0] & Qt::KeyboardModifierMask) == Qt::ShiftModifier)) { | |
372 QShortcut *newSc = new QShortcut(sc, a->parentWidget()); | 379 QShortcut *newSc = new QShortcut(sc, a->parentWidget()); |
373 QObject::connect(newSc, SIGNAL(activated()), | 380 QObject::connect(newSc, SIGNAL(activated()), |
374 m_menuShortcutMapper, SLOT(map())); | 381 m_menuShortcutMapper, SLOT(map())); |
375 m_menuShortcutMapper->setMapping(newSc, a); | 382 m_menuShortcutMapper->setMapping(newSc, a); |
376 m_appShortcuts.push_back(newSc); | 383 m_appShortcuts.push_back(newSc); |