From f978f6a54b60c5ee1e9260e0bdb074c047992725 Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Thu, 9 Apr 2015 15:56:29 +0200 Subject: [PATCH] Custom Executable RunConfiguration: Esc should close dialog Change-Id: Ifaa4d87c73d2597a018d867f3c081113132e76ee Task-number: QTCREATORBUG-14202 Reviewed-by: Friedemann Kleint --- .../qtsupport/customexecutablerunconfiguration.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/plugins/qtsupport/customexecutablerunconfiguration.cpp b/src/plugins/qtsupport/customexecutablerunconfiguration.cpp index fcf62fc3c96..229751b5d93 100644 --- a/src/plugins/qtsupport/customexecutablerunconfiguration.cpp +++ b/src/plugins/qtsupport/customexecutablerunconfiguration.cpp @@ -115,6 +115,8 @@ public: void accept(); + bool event(QEvent *event); + private slots: void changed() { @@ -157,6 +159,18 @@ void CustomExecutableDialog::accept() QDialog::accept(); } +bool CustomExecutableDialog::event(QEvent *event) +{ + if (event->type() == QEvent::ShortcutOverride) { + QKeyEvent *ke = static_cast(event); + if (ke->key() == Qt::Key_Escape && !ke->modifiers()) { + ke->accept(); + return true; + } + } + return QDialog::event(event); +} + // CustomExecutableRunConfiguration RunConfiguration::ConfigurationState CustomExecutableRunConfiguration::ensureConfigured(QString *errorMessage)