summary refs log tree commit diff
path: root/src/dialogs/PreviewUploadOverlay.h
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2019-07-22 02:38:44 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2019-07-22 02:38:44 +0200
commitcefe5fe71945c89b7b65c6ed2cb127a404cf62f5 (patch)
tree64bb6b26deb0a65777e53ae04a52152a9cae9e33 /src/dialogs/PreviewUploadOverlay.h
parentActually set attributes before starting the app (diff)
downloadnheko-cefe5fe71945c89b7b65c6ed2cb127a404cf62f5.tar.xz
Fix copy and pasting image from clipboard
If the QMimeData contains an image, it actually has a mime type of
application/x-qt-image. At least in some cases accessing the image/*
data returns a 0 length array. Accessing the data via ->imageData works
however. So we use that as our accessor and pass it to the preview
dialog.
Diffstat (limited to '')
-rw-r--r--src/dialogs/PreviewUploadOverlay.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/dialogs/PreviewUploadOverlay.h b/src/dialogs/PreviewUploadOverlay.h
index 8099d9c2..11cd49bc 100644
--- a/src/dialogs/PreviewUploadOverlay.h
+++ b/src/dialogs/PreviewUploadOverlay.h
@@ -17,6 +17,7 @@
 
 #pragma once
 
+#include <QImage>
 #include <QLabel>
 #include <QLineEdit>
 #include <QPixmap>
@@ -33,6 +34,7 @@ class PreviewUploadOverlay : public QWidget
 public:
         PreviewUploadOverlay(QWidget *parent = nullptr);
 
+        void setPreview(const QImage &src, const QString &mime);
         void setPreview(const QByteArray data, const QString &mime);
         void setPreview(const QString &path);