mirror of
https://github.com/tnodir/fort
synced 2024-11-15 08:25:20 +00:00
UI: Close windows by Escape key immediately
This commit is contained in:
parent
470ec4248a
commit
2b367f84da
@ -53,11 +53,8 @@ void WidgetWindow::keyPressEvent(QKeyEvent *event)
|
|||||||
{
|
{
|
||||||
QWidget::keyPressEvent(event);
|
QWidget::keyPressEvent(event);
|
||||||
|
|
||||||
if (event->isAutoRepeat())
|
|
||||||
return;
|
|
||||||
|
|
||||||
switch (event->key()) {
|
switch (event->key()) {
|
||||||
case Qt::Key_Escape: // Esc
|
case Qt::Key_Escape:
|
||||||
if (event->modifiers() == Qt::NoModifier) {
|
if (event->modifiers() == Qt::NoModifier) {
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user