Bitcoin Core  22.99.0
P2P Digital Currency
transactionview.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2020 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,
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
TransactionView
Widget showing the transaction list for a wallet, including a filter row.
Definition: transactionview.h:32
TransactionView::TYPE_COLUMN_WIDTH
@ TYPE_COLUMN_WIDTH
Definition: transactionview.h:58
TransactionView::createDateRangeWidget
QWidget * createDateRangeWidget()
Definition: transactionview.cpp:549
TransactionView::search_widget
QLineEdit * search_widget
Definition: transactionview.h:74
TransactionView::editLabel
void editLabel()
Definition: transactionview.cpp:481
TransactionView::m_platform_style
const PlatformStyle * m_platform_style
Definition: transactionview.h:91
WalletModel
Interface to Bitcoin wallet from Qt view code.
Definition: walletmodel.h:51
TransactionView::openThirdPartyTxUrl
void openThirdPartyTxUrl(QString url)
Definition: transactionview.cpp:540
TransactionView::~TransactionView
~TransactionView()
Definition: transactionview.cpp:201
TransactionView::abandonAction
QAction * abandonAction
Definition: transactionview.h:82
TransactionView::DateEnum
DateEnum
Definition: transactionview.h:43
TransactionView::bumpFee
void bumpFee(bool checked)
Definition: transactionview.cpp:428
TransactionView::ThisYear
@ ThisYear
Definition: transactionview.h:50
TransactionView::focusTransaction
void focusTransaction(const QModelIndex &)
Definition: transactionview.cpp:594
TransactionView::ColumnWidths
ColumnWidths
Definition: transactionview.h:54
uint256.h
TransactionView::ThisMonth
@ ThisMonth
Definition: transactionview.h:48
TransactionView::LastMonth
@ LastMonth
Definition: transactionview.h:49
TransactionView::STATUS_COLUMN_WIDTH
@ STATUS_COLUMN_WIDTH
Definition: transactionview.h:55
TransactionView::chooseWatchonly
void chooseWatchonly(int idx)
Definition: transactionview.cpp:321
TransactionView::transactionView
QTableView * transactionView
Definition: transactionview.h:69
TransactionView::copyTxID
void copyTxID()
Definition: transactionview.cpp:466
TransactionView::dateTo
QDateTimeEdit * dateTo
Definition: transactionview.h:81
url
const char * url
Definition: rpcconsole.cpp:62
TransactionView::showDetails
void showDetails()
Definition: transactionview.cpp:527
TransactionView::changedSearch
void changedSearch()
Definition: transactionview.cpp:329
TransactionView::changedAmount
void changedAmount()
Definition: transactionview.cpp:336
guiutil.h
TransactionView::DATE_COLUMN_WIDTH
@ DATE_COLUMN_WIDTH
Definition: transactionview.h:57
TransactionView::eventFilter
bool eventFilter(QObject *obj, QEvent *event) override
Definition: transactionview.cpp:631
TransactionView::copyAmount
void copyAmount()
Definition: transactionview.cpp:461
TransactionView::message
void message(const QString &title, const QString &message, unsigned int style)
Fired when a message should be reported to the user.
TransactionView::All
@ All
Definition: transactionview.h:45
uint256
256-bit opaque blob.
Definition: uint256.h:124
TransactionView::transactionProxyModel
TransactionFilterProxy * transactionProxyModel
Definition: transactionview.h:68
TransactionView::dateRangeChanged
void dateRangeChanged()
Definition: transactionview.cpp:585
TransactionView::copyLabel
void copyLabel()
Definition: transactionview.cpp:456
TransactionView::watchOnlyWidget
QComboBox * watchOnlyWidget
Definition: transactionview.h:73
TransactionView::WATCHONLY_COLUMN_WIDTH
@ WATCHONLY_COLUMN_WIDTH
Definition: transactionview.h:56
TransactionView::updateWatchOnlyColumn
void updateWatchOnlyColumn(bool fHaveWatchOnly)
Definition: transactionview.cpp:646
TransactionView::bumpedFee
void bumpedFee(const uint256 &txid)
TransactionView::MINIMUM_COLUMN_WIDTH
@ MINIMUM_COLUMN_WIDTH
Definition: transactionview.h:60
TransactionView::ThisWeek
@ ThisWeek
Definition: transactionview.h:47
TransactionView::contextMenu
QMenu * contextMenu
Definition: transactionview.h:77
TransactionView::copyLabelAction
QAction * copyLabelAction
Definition: transactionview.h:85
TransactionView::copyTxHex
void copyTxHex()
Definition: transactionview.cpp:471
TransactionView::chooseDate
void chooseDate(int idx)
Definition: transactionview.cpp:266
TransactionView::setModel
void setModel(WalletModel *model)
Definition: transactionview.cpp:207
TransactionView::copyAddress
void copyAddress()
Definition: transactionview.cpp:451
TransactionView::amountWidget
QLineEdit * amountWidget
Definition: transactionview.h:75
TransactionView::typeWidget
QComboBox * typeWidget
Definition: transactionview.h:72
TransactionView::abandonTx
void abandonTx()
Definition: transactionview.cpp:410
TransactionView::copyAddressAction
QAction * copyAddressAction
Definition: transactionview.h:84
TransactionView::contextualMenu
void contextualMenu(const QPoint &)
Definition: transactionview.cpp:390
TransactionView::changeEvent
void changeEvent(QEvent *e) override
Definition: transactionview.cpp:252
TransactionView::dateRangeWidget
QFrame * dateRangeWidget
Definition: transactionview.h:79
TransactionView::AMOUNT_MINIMUM_COLUMN_WIDTH
@ AMOUNT_MINIMUM_COLUMN_WIDTH
Definition: transactionview.h:59
TransactionView::chooseType
void chooseType(int idx)
Definition: transactionview.cpp:313
TransactionView::bumpFeeAction
QAction * bumpFeeAction
Definition: transactionview.h:83
TransactionView::TransactionView
TransactionView(const PlatformStyle *platformStyle, QWidget *parent=nullptr)
Definition: transactionview.cpp:42
TransactionView::doubleClicked
void doubleClicked(const QModelIndex &)
PlatformStyle
Definition: platformstyle.h:13
TransactionView::copyTxPlainText
void copyTxPlainText()
Definition: transactionview.cpp:476
TransactionView::model
WalletModel * model
Definition: transactionview.h:67
TransactionView::exportClicked
void exportClicked()
Definition: transactionview.cpp:350
TransactionView::dateWidget
QComboBox * dateWidget
Definition: transactionview.h:71
TransactionView::dateFrom
QDateTimeEdit * dateFrom
Definition: transactionview.h:80
TransactionView::Today
@ Today
Definition: transactionview.h:46
TransactionView::Range
@ Range
Definition: transactionview.h:51
TransactionFilterProxy
Filter the transaction list according to pre-specified rules.
Definition: transactionfilterproxy.h:16