Custom Executable RunConfiguration: Esc should close dialog

Change-Id: Ifaa4d87c73d2597a018d867f3c081113132e76ee
Task-number: QTCREATORBUG-14202
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This commit is contained in:
Daniel Teske
2015-04-09 15:56:29 +02:00
parent 763c4267e0
commit f978f6a54b

View File

@@ -115,6 +115,8 @@ public:
void accept(); void accept();
bool event(QEvent *event);
private slots: private slots:
void changed() void changed()
{ {
@@ -157,6 +159,18 @@ void CustomExecutableDialog::accept()
QDialog::accept(); QDialog::accept();
} }
bool CustomExecutableDialog::event(QEvent *event)
{
if (event->type() == QEvent::ShortcutOverride) {
QKeyEvent *ke = static_cast<QKeyEvent *>(event);
if (ke->key() == Qt::Key_Escape && !ke->modifiers()) {
ke->accept();
return true;
}
}
return QDialog::event(event);
}
// CustomExecutableRunConfiguration // CustomExecutableRunConfiguration
RunConfiguration::ConfigurationState CustomExecutableRunConfiguration::ensureConfigured(QString *errorMessage) RunConfiguration::ConfigurationState CustomExecutableRunConfiguration::ensureConfigured(QString *errorMessage)