From 2108d98c6dc336178ab7342eee9167158ee35175 Mon Sep 17 00:00:00 2001 From: salahmak Date: Sat, 20 Mar 2021 21:09:04 +0100 Subject: [PATCH] Pressing escape hides PreviewUploadOverlay --- src/dialogs/PreviewUploadOverlay.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/dialogs/PreviewUploadOverlay.cpp b/src/dialogs/PreviewUploadOverlay.cpp index c0a02bdd..66fa1b37 100644 --- a/src/dialogs/PreviewUploadOverlay.cpp +++ b/src/dialogs/PreviewUploadOverlay.cpp @@ -207,9 +207,10 @@ PreviewUploadOverlay::setPreview(const QString &path) void PreviewUploadOverlay::keyPressEvent(QKeyEvent *event) { - if( event->key() == Qt::Key_Escape ) - { - emit aborted(); - close(); + if (event->matches(QKeySequence::Cancel)) { + emit aborted(); + close(); + } else { + QWidget::keyPressEvent(event); } } \ No newline at end of file