aboutsummaryrefslogtreecommitdiff
path: root/src/qt/receiverequestdialog.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2013-10-18 13:08:30 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2013-10-23 09:15:25 +0200
commit82095923bb71a670aa67ad15987bb6d4d7726abe (patch)
tree1bd9b4747659277bb365d8d56008fbed9ead0945 /src/qt/receiverequestdialog.h
parent864a6f790ee80a4acc56189cdc1897c9a3ed6998 (diff)
qt: allow dragging, copying and saving QR code
Add context menu and drag handling to QR code widget.
Diffstat (limited to 'src/qt/receiverequestdialog.h')
-rw-r--r--src/qt/receiverequestdialog.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/qt/receiverequestdialog.h b/src/qt/receiverequestdialog.h
index 37a3fa22d6..e560a24ff1 100644
--- a/src/qt/receiverequestdialog.h
+++ b/src/qt/receiverequestdialog.h
@@ -3,12 +3,32 @@
#include <QDialog>
#include <QImage>
+#include <QLabel>
namespace Ui {
class ReceiveRequestDialog;
}
class OptionsModel;
+/* Label widget for QR code. This image can be dragged, dropped, copied and saved
+ * to disk.
+ */
+class QRImageWidget : public QLabel
+{
+ Q_OBJECT
+
+public:
+ explicit QRImageWidget(QWidget *parent = 0);
+ QImage exportImage();
+
+public slots:
+ void saveImage();
+ void copyImage();
+
+protected:
+ virtual void mousePressEvent(QMouseEvent *event);
+};
+
class ReceiveRequestDialog : public QDialog
{
Q_OBJECT
@@ -23,7 +43,6 @@ private slots:
void on_lnReqAmount_textChanged();
void on_lnLabel_textChanged();
void on_lnMessage_textChanged();
- void on_btnSaveAs_clicked();
void updateDisplayUnit();
@@ -31,7 +50,6 @@ private:
Ui::ReceiveRequestDialog *ui;
OptionsModel *model;
QString address;
- QImage myImage;
void genCode();
QString getURI();