Commit a88599ae authored by Eike Ziller's avatar Eike Ziller

Fix escape key for "About Qt Creator"

Change-Id: I15c49541a6914c8db58784935de43f0b046895b0
Reviewed-by: default avatarRobert Loehning <robert.loehning@digia.com>
parent 4ff03aa7
......@@ -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);
}
......@@ -32,6 +32,10 @@
#include <QDialog>
QT_BEGIN_NAMESPACE
class QEvent;
QT_END_NAMESPACE
namespace Core {
namespace Internal {
......@@ -40,6 +44,9 @@ class VersionDialog : public QDialog
Q_OBJECT
public:
explicit VersionDialog(QWidget *parent);
bool event(QEvent *event);
};
} // namespace Internal
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment