diff options
Diffstat (limited to 'src/qt/guiutil.cpp')
-rw-r--r-- | src/qt/guiutil.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 9dde2c392c..955f5cdfe3 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -49,6 +49,7 @@ #include <QDoubleValidator> #include <QFileDialog> #include <QFont> +#include <QKeyEvent> #include <QLineEdit> #include <QSettings> #include <QTextDocument> // for Qt::mightBeRichText @@ -927,4 +928,14 @@ void ClickableProgressBar::mouseReleaseEvent(QMouseEvent *event) Q_EMIT clicked(event->pos()); } +bool ItemDelegate::eventFilter(QObject *object, QEvent *event) +{ + if (event->type() == QEvent::KeyPress) { + if (static_cast<QKeyEvent*>(event)->key() == Qt::Key_Escape) { + Q_EMIT keyEscapePressed(); + } + } + return QItemDelegate::eventFilter(object, event); +} + } // namespace GUIUtil |