diff --git a/src/dialogs/ImageOverlay.cpp b/src/dialogs/ImageOverlay.cpp index f38b29f5..0a3777f0 100644 --- a/src/dialogs/ImageOverlay.cpp +++ b/src/dialogs/ImageOverlay.cpp @@ -31,6 +31,8 @@ ImageOverlay::ImageOverlay(QPixmap image, QWidget *parent) connect(this, SIGNAL(closing()), this, SLOT(close())); + close_shortcut_ = new QShortcut(QKeySequence(Qt::Key_Escape), this, SLOT(close())); + raise(); } diff --git a/src/dialogs/ImageOverlay.h b/src/dialogs/ImageOverlay.h index 93b6afdc..9d4187bf 100644 --- a/src/dialogs/ImageOverlay.h +++ b/src/dialogs/ImageOverlay.h @@ -8,6 +8,7 @@ #include #include #include +#include namespace dialogs { @@ -32,5 +33,6 @@ private: QRect content_; QRect close_button_; QRect save_button_; + QShortcut *close_shortcut_; }; } // dialogs