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 <QDialogButtonBox>
|
||||||
#include <QGridLayout>
|
#include <QGridLayout>
|
||||||
|
#include <QKeyEvent>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
|
||||||
@@ -97,3 +98,15 @@ VersionDialog::VersionDialog(QWidget *parent)
|
|||||||
layout->addWidget(copyRightLabel, 0, 1, 4, 4);
|
layout->addWidget(copyRightLabel, 0, 1, 4, 4);
|
||||||
layout->addWidget(buttonBox, 4, 0, 1, 5);
|
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>
|
#include <QDialog>
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
class QEvent;
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
@@ -40,6 +44,9 @@ class VersionDialog : public QDialog
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit VersionDialog(QWidget *parent);
|
explicit VersionDialog(QWidget *parent);
|
||||||
|
|
||||||
|
bool event(QEvent *event);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
Reference in New Issue
Block a user