You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

receiverequestdialog.h 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // Copyright (c) 2011-2016 The Starwels developers
  2. // Distributed under the MIT software license, see the accompanying
  3. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
  4. #ifndef STARWELS_QT_RECEIVEREQUESTDIALOG_H
  5. #define STARWELS_QT_RECEIVEREQUESTDIALOG_H
  6. #include "walletmodel.h"
  7. #include <QDialog>
  8. #include <QImage>
  9. #include <QLabel>
  10. #include <QPainter>
  11. class OptionsModel;
  12. namespace Ui {
  13. class ReceiveRequestDialog;
  14. }
  15. QT_BEGIN_NAMESPACE
  16. class QMenu;
  17. QT_END_NAMESPACE
  18. /* Label widget for QR code. This image can be dragged, dropped, copied and saved
  19. * to disk.
  20. */
  21. class QRImageWidget : public QLabel
  22. {
  23. Q_OBJECT
  24. public:
  25. explicit QRImageWidget(QWidget *parent = 0);
  26. QImage exportImage();
  27. public Q_SLOTS:
  28. void saveImage();
  29. void copyImage();
  30. protected:
  31. virtual void mousePressEvent(QMouseEvent *event);
  32. virtual void contextMenuEvent(QContextMenuEvent *event);
  33. private:
  34. QMenu *contextMenu;
  35. };
  36. class ReceiveRequestDialog : public QDialog
  37. {
  38. Q_OBJECT
  39. public:
  40. explicit ReceiveRequestDialog(QWidget *parent = 0);
  41. ~ReceiveRequestDialog();
  42. void setModel(OptionsModel *model);
  43. void setInfo(const SendCoinsRecipient &info);
  44. private Q_SLOTS:
  45. void on_btnCopyURI_clicked();
  46. void on_btnCopyAddress_clicked();
  47. void update();
  48. private:
  49. Ui::ReceiveRequestDialog *ui;
  50. OptionsModel *model;
  51. SendCoinsRecipient info;
  52. };
  53. #endif // STARWELS_QT_RECEIVEREQUESTDIALOG_H