forked from qt-creator/qt-creator
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:
@@ -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<QKeyEvent *>(event);
|
||||
if (ke->key() == Qt::Key_Escape && !ke->modifiers()) {
|
||||
ke->accept();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return QDialog::event(event);
|
||||
}
|
||||
|
||||
// CustomExecutableRunConfiguration
|
||||
|
||||
RunConfiguration::ConfigurationState CustomExecutableRunConfiguration::ensureConfigured(QString *errorMessage)
|
||||
|
Reference in New Issue
Block a user