revised handling to work with macs

main
Joel Smith 2020-07-01 10:37:12 -07:00
parent c9a519459f
commit 47bc60fd2c
1 changed files with 2 additions and 9 deletions

View File

@ -76,19 +76,12 @@ void Settings::closeEvent(QCloseEvent *event) {
}
void Settings::keyPressEvent(QKeyEvent *evt) {
#ifdef Q_OS_MACOS
if( evt->key() == Qt::Key_W && evt->modifiers() == Qt::MetaModifier) {
onCancelClicked();
close(); // not needed once onCancelClick implements close directly (other branch)
}
#else
QDialog::keyPressEvent(evt);
// Note: Qt::ControlModifier corresponds to Cmd on the mac (meta corresponds to mac control key)
if( evt->key() == Qt::Key_W && evt->modifiers() == Qt::ControlModifier) {
onCancelClicked();
close(); // not needed once onCancelClick implements close directly (other branch)
}
#endif
QDialog::keyPressEvent(evt);
}
void Settings::onCancelClicked() {