revised handling to work with macs
parent
c9a519459f
commit
47bc60fd2c
|
@ -76,19 +76,12 @@ void Settings::closeEvent(QCloseEvent *event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::keyPressEvent(QKeyEvent *evt) {
|
void Settings::keyPressEvent(QKeyEvent *evt) {
|
||||||
#ifdef Q_OS_MACOS
|
QDialog::keyPressEvent(evt);
|
||||||
if( evt->key() == Qt::Key_W && evt->modifiers() == Qt::MetaModifier) {
|
// Note: Qt::ControlModifier corresponds to Cmd on the mac (meta corresponds to mac control key)
|
||||||
onCancelClicked();
|
|
||||||
close(); // not needed once onCancelClick implements close directly (other branch)
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
if( evt->key() == Qt::Key_W && evt->modifiers() == Qt::ControlModifier) {
|
if( evt->key() == Qt::Key_W && evt->modifiers() == Qt::ControlModifier) {
|
||||||
onCancelClicked();
|
onCancelClicked();
|
||||||
close(); // not needed once onCancelClick implements close directly (other branch)
|
close(); // not needed once onCancelClick implements close directly (other branch)
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
QDialog::keyPressEvent(evt);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::onCancelClicked() {
|
void Settings::onCancelClicked() {
|
||||||
|
|
Loading…
Reference in New Issue