Bitcoin Core  0.20.99
P2P Digital Currency
transactionview.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2019 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);
38 
39  void setModel(WalletModel *model);
40 
41  // Date ranges for filter
42  enum DateEnum
43  {
44  All,
51  };
52 
53  enum ColumnWidths {
60  };
61 
62 private:
63  WalletModel *model{nullptr};
65  QTableView *transactionView{nullptr};
66 
67  QComboBox *dateWidget;
68  QComboBox *typeWidget;
69  QComboBox *watchOnlyWidget;
70  QLineEdit *search_widget;
71  QLineEdit *amountWidget;
72 
73  QMenu *contextMenu;
74 
75  QFrame *dateRangeWidget;
76  QDateTimeEdit *dateFrom;
77  QDateTimeEdit *dateTo;
78  QAction *abandonAction{nullptr};
79  QAction *bumpFeeAction{nullptr};
80  QAction *copyAddressAction{nullptr};
81  QAction *copyLabelAction{nullptr};
82 
83  QWidget *createDateRangeWidget();
84 
86 
87  virtual void resizeEvent(QResizeEvent* event) override;
88 
89  bool eventFilter(QObject *obj, QEvent *event) override;
90 
91 private Q_SLOTS:
92  void contextualMenu(const QPoint &);
93  void dateRangeChanged();
94  void showDetails();
95  void copyAddress();
96  void editLabel();
97  void copyLabel();
98  void copyAmount();
99  void copyTxID();
100  void copyTxHex();
101  void copyTxPlainText();
102  void openThirdPartyTxUrl(QString url);
103  void updateWatchOnlyColumn(bool fHaveWatchOnly);
104  void abandonTx();
105  void bumpFee();
106 
107 Q_SIGNALS:
108  void doubleClicked(const QModelIndex&);
109 
111  void message(const QString &title, const QString &message, unsigned int style);
112 
113  void bumpedFee(const uint256& txid);
114 
115 public Q_SLOTS:
116  void chooseDate(int idx);
117  void chooseType(int idx);
118  void chooseWatchonly(int idx);
119  void changedAmount();
120  void changedSearch();
121  void exportClicked();
122  void focusTransaction(const QModelIndex&);
123  void focusTransaction(const uint256& txid);
124 };
125 
126 #endif // BITCOIN_QT_TRANSACTIONVIEW_H
void openThirdPartyTxUrl(QString url)
QWidget * createDateRangeWidget()
QAction * abandonAction
void focusTransaction(const QModelIndex &)
QTableView * transactionView
void chooseWatchonly(int idx)
QDateTimeEdit * dateTo
const char * url
Definition: rpcconsole.cpp:51
void message(const QString &title, const QString &message, unsigned int style)
Fired when a message should be reported to the user.
Widget showing the transaction list for a wallet, including a filter row.
Makes a QTableView last column feel as if it was being resized from its left border.
Definition: guiutil.h:189
void updateWatchOnlyColumn(bool fHaveWatchOnly)
bool eventFilter(QObject *obj, QEvent *event) override
void bumpedFee(const uint256 &txid)
TransactionFilterProxy * transactionProxyModel
QAction * copyLabelAction
QComboBox * watchOnlyWidget
256-bit opaque blob.
Definition: uint256.h:124
void chooseDate(int idx)
void setModel(WalletModel *model)
QLineEdit * amountWidget
QComboBox * typeWidget
Filter the transaction list according to pre-specified rules.
Interface to Bitcoin wallet from Qt view code.
Definition: walletmodel.h:51
virtual void resizeEvent(QResizeEvent *event) override
QFrame * dateRangeWidget
TransactionView(const PlatformStyle *platformStyle, QWidget *parent=nullptr)
QAction * copyAddressAction
void contextualMenu(const QPoint &)
void chooseType(int idx)
QAction * bumpFeeAction
GUIUtil::TableViewLastColumnResizingFixer * columnResizingFixer
QDateTimeEdit * dateFrom
void doubleClicked(const QModelIndex &)
WalletModel * model
QComboBox * dateWidget
QLineEdit * search_widget