Bitcoin Core  24.99.0
P2P Digital Currency
transactionview.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2021 The Bitcoin 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 BITCOIN_QT_TRANSACTIONVIEW_H
6 #define BITCOIN_QT_TRANSACTIONVIEW_H
7 
8 #include <qt/guiutil.h>
9 
10 #include <uint256.h>
11 
12 #include <QWidget>
13 #include <QKeyEvent>
14 
15 class PlatformStyle;
17 class WalletModel;
18 
19 QT_BEGIN_NAMESPACE
20 class QComboBox;
21 class QDateTimeEdit;
22 class QFrame;
23 class QLineEdit;
24 class QMenu;
25 class QModelIndex;
26 class QTableView;
27 QT_END_NAMESPACE
28 
32 class TransactionView : public QWidget
33 {
34  Q_OBJECT
35 
36 public:
37  explicit TransactionView(const PlatformStyle *platformStyle, QWidget *parent = nullptr);
39 
40  void setModel(WalletModel *model);
41 
42  // Date ranges for filter
43  enum DateEnum
44  {
45  All,
51  Range
52  };
53 
54  enum ColumnWidths {
61  };
62 
63 protected:
64  void changeEvent(QEvent* e) override;
65 
66 private:
67  WalletModel *model{nullptr};
69  QTableView *transactionView{nullptr};
70 
71  QComboBox *dateWidget;
72  QComboBox *typeWidget;
73  QComboBox *watchOnlyWidget;
74  QLineEdit *search_widget;
75  QLineEdit *amountWidget;
76 
77  QMenu *contextMenu;
78 
79  QFrame *dateRangeWidget;
80  QDateTimeEdit *dateFrom;
81  QDateTimeEdit *dateTo;
82  QAction *abandonAction{nullptr};
83  QAction *bumpFeeAction{nullptr};
84  QAction *copyAddressAction{nullptr};
85  QAction *copyLabelAction{nullptr};
86 
87  QWidget *createDateRangeWidget();
88 
89  bool eventFilter(QObject *obj, QEvent *event) override;
90 
92 
93 private Q_SLOTS:
94  void contextualMenu(const QPoint &);
95  void dateRangeChanged();
96  void showDetails();
97  void copyAddress();
98  void editLabel();
99  void copyLabel();
100  void copyAmount();
101  void copyTxID();
102  void copyTxHex();
103  void copyTxPlainText();
104  void openThirdPartyTxUrl(QString url);
105  void updateWatchOnlyColumn(bool fHaveWatchOnly);
106  void abandonTx();
107  void bumpFee(bool checked);
108 
109 Q_SIGNALS:
110  void doubleClicked(const QModelIndex&);
111 
113  void message(const QString &title, const QString &message, unsigned int style);
114 
115  void bumpedFee(const uint256& txid);
116 
117 public Q_SLOTS:
118  void chooseDate(int idx);
119  void chooseType(int idx);
120  void chooseWatchonly(int idx);
121  void changedAmount();
122  void changedSearch();
123  void exportClicked();
124  void focusTransaction(const QModelIndex&);
125  void focusTransaction(const uint256& txid);
126 };
127 
128 #endif // BITCOIN_QT_TRANSACTIONVIEW_H
Filter the transaction list according to pre-specified rules.
Widget showing the transaction list for a wallet, including a filter row.
WalletModel * model
const PlatformStyle * m_platform_style
void chooseWatchonly(int idx)
void bumpFee(bool checked)
TransactionView(const PlatformStyle *platformStyle, QWidget *parent=nullptr)
QComboBox * typeWidget
QLineEdit * search_widget
bool eventFilter(QObject *obj, QEvent *event) override
QDateTimeEdit * dateFrom
QWidget * createDateRangeWidget()
void setModel(WalletModel *model)
void updateWatchOnlyColumn(bool fHaveWatchOnly)
void message(const QString &title, const QString &message, unsigned int style)
Fired when a message should be reported to the user.
void chooseType(int idx)
QAction * bumpFeeAction
void changeEvent(QEvent *e) override
QComboBox * watchOnlyWidget
QAction * abandonAction
QFrame * dateRangeWidget
QDateTimeEdit * dateTo
TransactionFilterProxy * transactionProxyModel
QTableView * transactionView
void focusTransaction(const QModelIndex &)
void chooseDate(int idx)
void contextualMenu(const QPoint &)
QComboBox * dateWidget
QAction * copyAddressAction
void bumpedFee(const uint256 &txid)
void openThirdPartyTxUrl(QString url)
QAction * copyLabelAction
void doubleClicked(const QModelIndex &)
QLineEdit * amountWidget
Interface to Bitcoin wallet from Qt view code.
Definition: walletmodel.h:53
256-bit opaque blob.
Definition: uint256.h:119
const char * url
Definition: rpcconsole.cpp:58