Add close after Escape pressed on info and config windows

This commit is contained in:
lupoDharkael
2017-05-25 15:11:14 +02:00
parent bc1f442d21
commit 3718a45394
4 changed files with 21 additions and 0 deletions

View File

@@ -23,6 +23,7 @@
#include <QVBoxLayout>
#include <QGroupBox>
#include <QLabel>
#include <QKeyEvent>
// ConfigWindow contains the menus where you can configure the application
@@ -47,5 +48,12 @@ ConfigWindow::ConfigWindow(QWidget *parent) : QWidget(parent) {
m_buttonListView->setFlow(QListWidget::TopToBottom);
baseLayout->addWidget(m_buttonListView);
show();
}
void ConfigWindow::keyPressEvent(QKeyEvent *e) {
if (e->key() == Qt::Key_Escape) {
close();
}
}