diff options
author | Simon Rettberg | 2019-10-18 13:19:39 +0200 |
---|---|---|
committer | Simon Rettberg | 2019-10-18 13:19:39 +0200 |
commit | a8feecc51cc4cda123816a7bf1a39aa1a438203b (patch) | |
tree | 00c8e6f617b0562f04715257f1c4ae060d43533e | |
parent | Always check session validity, not just if user has a config file... (diff) | |
download | vmchooser2-a8feecc51cc4cda123816a7bf1a39aa1a438203b.tar.gz vmchooser2-a8feecc51cc4cda123816a7bf1a39aa1a438203b.tar.xz vmchooser2-a8feecc51cc4cda123816a7bf1a39aa1a438203b.zip |
Properly handle key press events; prevent double-execution
-rw-r--r-- | src/dialog.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/dialog.cpp b/src/dialog.cpp index c6df761..914448f 100644 --- a/src/dialog.cpp +++ b/src/dialog.cpp @@ -730,12 +730,18 @@ void Dialog::on_helpNewsButton_clicked() { void Dialog::keyPressEvent(QKeyEvent* event) { switch(event->key()) { - case Qt::Key_Return: this->on_pushButtonStart_clicked(); break; - case Qt::Key_Escape: this->on_pushButtonAbort_clicked(); break; - case Qt::Key_H: this->on_helpNewsButton_clicked(); break; - default: break; + case Qt::Key_Return: + event->accept(); + this->on_pushButtonStart_clicked(); + break; + case Qt::Key_Escape: + event->accept(); + this->on_pushButtonAbort_clicked(); + break; + default: + QDialog::keyPressEvent(event); + break; } - QDialog::keyPressEvent(event); } void Dialog::iconDownloaded(const QUrl& url, const QIcon&) { |