PIVX Core  5.6.99
P2P Digital Currency
addresseswidget.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_ADDRESSESWIDGET_H
6 #define PIVX_QT_ADDRESSESWIDGET_H
7 
8 #include "addresstablemodel.h"
10 #include "pwidget.h"
11 
12 #include <QWidget>
13 
15 class TooltipMenu;
16 class PIVXGUI;
17 class WalletModel;
18 
19 namespace Ui {
20 class AddressesWidget;
21 }
22 
23 QT_BEGIN_NAMESPACE
24 class QModelIndex;
25 QT_END_NAMESPACE
26 
27 class AddressesWidget : public PWidget
28 {
29  Q_OBJECT
30 
31 public:
32  explicit AddressesWidget(PIVXGUI* parent);
34 
35  void loadWalletModel() override;
36 
37 private Q_SLOTS:
38  void handleAddressClicked(const QModelIndex &index);
39  void onStoreContactClicked();
40  void onEditClicked();
41  void onDeleteClicked();
42  void onCopyClicked();
44  void onSortChanged(int idx);
45  void onSortOrderChanged(int idx);
46 
47  void changeTheme(bool isLightTheme, QString &theme) override;
48 private:
49  Ui::AddressesWidget *ui;
50 
54 
55  TooltipMenu* menu = nullptr;
56 
57  // Cached index
58  QModelIndex index;
59 
60  // Cached sort type and order
62  Qt::SortOrder sortOrder = Qt::AscendingOrder;
63 
64  void updateListView();
65  void sortAddresses();
66 };
67 
68 #endif // PIVX_QT_ADDRESSESWIDGET_H
Qt model of the address book in the core.
@ Label
User specified label.
AddressTableModel::ColumnIndex sortType
void onAddContactShowHideClicked()
FurAbstractListItemDelegate * delegate
AddressesWidget(PIVXGUI *parent)
AddressFilterProxyModel * filter
void loadWalletModel() override
void handleAddressClicked(const QModelIndex &index)
void onSortChanged(int idx)
void changeTheme(bool isLightTheme, QString &theme) override
void onSortOrderChanged(int idx)
AddressTableModel * addressTablemodel
QModelIndex index
Ui::AddressesWidget * ui
Qt::SortOrder sortOrder
TooltipMenu * menu
PIVX GUI main class.
Definition: pivxgui.h:46
Interface to PIVX wallet from Qt view code.
Definition: walletmodel.h:109
bool isLightTheme()
Definition: qtutils.cpp:210