PIVX Core  5.6.99
P2P Digital Currency
receivewidget.h
Go to the documentation of this file.
1 // Copyright (c) 2019-2021 The PIVX Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef PIVX_QT_RECEIVEWIDGET_H
6 #define PIVX_QT_RECEIVEWIDGET_H
7 
9 #include "addresstablemodel.h"
11 #include "pwidget.h"
12 
13 #include <QSpacerItem>
14 #include <QWidget>
15 #include <QPixmap>
16 
17 class PIVXGUI;
18 class SendCoinsRecipient;
19 
20 namespace Ui {
21 class ReceiveWidget;
22 }
23 
24 QT_BEGIN_NAMESPACE
25 class QModelIndex;
26 QT_END_NAMESPACE
27 
28 class ReceiveWidget : public PWidget
29 {
30  Q_OBJECT
31 
32 public:
33  explicit ReceiveWidget(PIVXGUI* parent);
35 
36  void loadWalletModel() override;
37 
38 public Q_SLOTS:
39  void onRequestClicked();
40  void onMyAddressesClicked();
41  void onNewAddressClicked();
42 
43 private Q_SLOTS:
44  void changeTheme(bool isLightTheme, QString &theme) override ;
45  void onLabelClicked();
46  void onCopyClicked();
47  void refreshView(const QModelIndex& tl, const QModelIndex& br);
48  void refreshView(const QString& refreshAddress = QString());
49  void handleAddressClicked(const QModelIndex &index);
50  void onSortChanged(int idx);
51  void onSortOrderChanged(int idx);
52  void filterChanged(const QString& str);
53 
54 private:
55  Ui::ReceiveWidget *ui{nullptr};
56 
60 
61  QSpacerItem *spacer{nullptr};
62 
63  // Cached last address
65 
66  // Cached sort type and order
68  Qt::SortOrder sortOrder = Qt::AscendingOrder;
69 
70  void updateQr(const QString& address);
71  void updateLabel();
72  void showAddressGenerationDialog(bool isPaymentRequest);
73  void sortAddresses();
74  void onTransparentSelected(bool transparentSelected);
75 
76  bool isShowingDialog{false};
77  // Whether the main section is presenting a shielded address or a regular one
78  bool shieldedMode{false};
79 
80 };
81 
82 #endif // PIVX_QT_RECEIVEWIDGET_H
Qt model of the address book in the core.
@ Label
User specified label.
PIVX GUI main class.
Definition: pivxgui.h:46
void changeTheme(bool isLightTheme, QString &theme) override
void refreshView(const QModelIndex &tl, const QModelIndex &br)
QSpacerItem * spacer
Definition: receivewidget.h:61
AddressTableModel::ColumnIndex sortType
Definition: receivewidget.h:67
void updateQr(const QString &address)
void handleAddressClicked(const QModelIndex &index)
bool isShowingDialog
Definition: receivewidget.h:76
AddressFilterProxyModel * filter
Definition: receivewidget.h:59
void onSortOrderChanged(int idx)
void showAddressGenerationDialog(bool isPaymentRequest)
void onTransparentSelected(bool transparentSelected)
SendCoinsRecipient * info
Definition: receivewidget.h:64
ReceiveWidget(PIVXGUI *parent)
Qt::SortOrder sortOrder
Definition: receivewidget.h:68
FurAbstractListItemDelegate * delegate
Definition: receivewidget.h:57
void filterChanged(const QString &str)
void onRequestClicked()
AddressTableModel * addressTableModel
Definition: receivewidget.h:58
void onMyAddressesClicked()
void onSortChanged(int idx)
void onNewAddressClicked()
Ui::ReceiveWidget * ui
Definition: receivewidget.h:55
void loadWalletModel() override
bool isLightTheme()
Definition: qtutils.cpp:210