Merge pull request #532 from salahmak/esc-cancel-upload
Pressing escape hides PreviewUploadOverlay
This commit is contained in:
commit
e46ddbbb45
@ -203,3 +203,14 @@ PreviewUploadOverlay::setPreview(const QString &path)
|
||||
setLabels(split[1], mime.name(), data_.size());
|
||||
init();
|
||||
}
|
||||
|
||||
void
|
||||
PreviewUploadOverlay::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
if (event->matches(QKeySequence::Cancel)) {
|
||||
emit aborted();
|
||||
close();
|
||||
} else {
|
||||
QWidget::keyPressEvent(event);
|
||||
}
|
||||
}
|
@ -25,6 +25,7 @@ public:
|
||||
void setPreview(const QImage &src, const QString &mime);
|
||||
void setPreview(const QByteArray data, const QString &mime);
|
||||
void setPreview(const QString &path);
|
||||
void keyPressEvent(QKeyEvent *event);
|
||||
|
||||
signals:
|
||||
void confirmUpload(const QByteArray data, const QString &media, const QString &filename);
|
||||
|
Loading…
Reference in New Issue
Block a user