forked from qt-creator/qt-creator
Fix escape key for "About Qt Creator"
Change-Id: I15c49541a6914c8db58784935de43f0b046895b0 Reviewed-by: Robert Loehning <robert.loehning@digia.com>
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
|
||||
#include <QDialogButtonBox>
|
||||
#include <QGridLayout>
|
||||
#include <QKeyEvent>
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
|
||||
@@ -97,3 +98,15 @@ VersionDialog::VersionDialog(QWidget *parent)
|
||||
layout->addWidget(copyRightLabel, 0, 1, 4, 4);
|
||||
layout->addWidget(buttonBox, 4, 0, 1, 5);
|
||||
}
|
||||
|
||||
bool VersionDialog::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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user