feat: control+w = close window

This commit is contained in:
DuckSoft 2020-08-13 19:10:09 +08:00
parent 828d68fb63
commit dfcd169444
No known key found for this signature in database
GPG Key ID: 7A3A9FA6E4FD4A8D

View File

@ -447,11 +447,18 @@ void MainWindow::keyPressEvent(QKeyEvent *e)
this->close();
}
}
// Ctrl + Q = Exit
else if (e->modifiers() & Qt::ControlModifier && e->key() == Qt::Key_Q)
{
if (QvMessageBoxAsk(this, tr("Quit Qv2ray"), tr("Are you sure to exit Qv2ray?")) == QMessageBox::Yes)
Action_Exit();
}
// Control + W = Close Window
else if (e->modifiers() & Qt::ControlModifier && e->key() == Qt::Key_W)
{
if (this->isActiveWindow())
this->close();
}
}
void MainWindow::keyReleaseEvent(QKeyEvent *e)