Bitcoin Core  31.0.0
P2P Digital Currency
transactionview.h
Go to the documentation of this file.
1 // Copyright (c) 2011-present 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 
11 #include <uint256.h>
12 
13 #include <QWidget>
14 #include <QKeyEvent>
15 
16 class PlatformStyle;
19 class WalletModel;
20 
21 QT_BEGIN_NAMESPACE
22 class QComboBox;
23 class QDateTimeEdit;
24 class QFrame;
25 class QLineEdit;
26 class QMenu;
27 class QModelIndex;
28 class QTableView;
29 QT_END_NAMESPACE
30 
34 class TransactionView : public QWidget
35 {
36  Q_OBJECT
37 
38 public:
39  explicit TransactionView(const PlatformStyle *platformStyle, QWidget *parent = nullptr);
41 
42  void setModel(WalletModel *model);
43 
44  // Date ranges for filter
45  enum DateEnum
46  {
47  All,
54  };
55 
56  enum ColumnWidths {
62  };
63 
64 protected:
65  void changeEvent(QEvent* e) override;
66 
67 private:
68  WalletModel *model{nullptr};
70  QTableView *transactionView{nullptr};
71 
72  QComboBox *dateWidget;
73  QComboBox *typeWidget;
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  QList<TransactionDescDialog*> m_opened_dialogs;
94 
95 private Q_SLOTS:
96  void contextualMenu(const QPoint &);
97  void dateRangeChanged();
98  void showDetails();
99  void copyAddress();
100  void editLabel();
101  void copyLabel();
102  void copyAmount();
103  void copyTxID();
104  void copyTxHex();
105  void copyTxPlainText();
106  void openThirdPartyTxUrl(QString url);
107  void abandonTx();
108  void bumpFee(bool checked);
109 
110 Q_SIGNALS:
111  void doubleClicked(const QModelIndex&);
112 
114  void message(const QString &title, const QString &message, unsigned int style);
115 
116  void bumpedFee(const Txid& txid);
117 
118 public Q_SLOTS:
119  void chooseDate(int idx);
120  void chooseType(int idx);
121  void changedAmount();
122  void changedSearch();
123  void exportClicked();
124  void closeOpenedDialogs();
125  void focusTransaction(const QModelIndex&);
126  void focusTransaction(const Txid& txid);
127 };
128 
129 #endif // BITCOIN_QT_TRANSACTIONVIEW_H
void openThirdPartyTxUrl(QString url)
QWidget * createDateRangeWidget()
Dialog showing transaction details.
const PlatformStyle * m_platform_style
QAction * abandonAction
void bumpFee(bool checked)
void focusTransaction(const QModelIndex &)
QTableView * transactionView
void bumpedFee(const Txid &txid)
QDateTimeEdit * dateTo
const char * url
Definition: rpcconsole.cpp:61
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.
bool eventFilter(QObject *obj, QEvent *event) override
TransactionFilterProxy * transactionProxyModel
QAction * copyLabelAction
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:48
QList< TransactionDescDialog * > m_opened_dialogs
QFrame * dateRangeWidget
TransactionView(const PlatformStyle *platformStyle, QWidget *parent=nullptr)
QAction * copyAddressAction
void contextualMenu(const QPoint &)
void changeEvent(QEvent *e) override
void chooseType(int idx)
QAction * bumpFeeAction
QDateTimeEdit * dateFrom
void doubleClicked(const QModelIndex &)
WalletModel * model
QComboBox * dateWidget
QLineEdit * search_widget