mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
qt: allow dragging, copying and saving QR code
Add context menu and drag handling to QR code widget.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user