Bitcoin ABC  0.26.3
P2P Digital Currency
transactionview.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2016 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 #include <uint256.h>
10 
11 #include <QKeyEvent>
12 #include <QWidget>
13 
14 class PlatformStyle;
16 class WalletModel;
17 
18 QT_BEGIN_NAMESPACE
19 class QComboBox;
20 class QDateTimeEdit;
21 class QFrame;
22 class QLineEdit;
23 class QMenu;
24 class QModelIndex;
25 class QTableView;
26 QT_END_NAMESPACE
27 
33 class TransactionView : public QWidget {
34  Q_OBJECT
35 
36 public:
37  explicit TransactionView(const PlatformStyle *platformStyle,
38  QWidget *parent = nullptr);
39 
40  void setModel(WalletModel *model);
41 
42  // Date ranges for filter
43  enum DateEnum {
44  All,
50  Range
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 *copyAddressAction{nullptr};
80  QAction *copyLabelAction{nullptr};
81 
82  QWidget *createDateRangeWidget();
83 
85 
86  virtual void resizeEvent(QResizeEvent *event) override;
87 
88  bool eventFilter(QObject *obj, QEvent *event) override;
89 
90 private Q_SLOTS:
91  void contextualMenu(const QPoint &);
92  void dateRangeChanged();
93  void showDetails();
94  void copyAddress();
95  void editLabel();
96  void copyLabel();
97  void copyAmount();
98  void copyTxID();
99  void copyTxHex();
100  void copyTxPlainText();
101  void openThirdPartyTxUrl(QString url);
102  void updateWatchOnlyColumn(bool fHaveWatchOnly);
103  void abandonTx();
104 
105 Q_SIGNALS:
106  void doubleClicked(const QModelIndex &);
107 
111  void message(const QString &title, const QString &message,
112  unsigned int style);
113 
114 public Q_SLOTS:
115  void chooseDate(int idx);
116  void chooseType(int idx);
117  void chooseWatchonly(int idx);
118  void changedAmount();
119  void changedSearch();
120  void exportClicked();
121  void focusTransaction(const QModelIndex &);
122  void focusTransaction(const uint256 &txid);
123 };
124 
125 #endif // BITCOIN_QT_TRANSACTIONVIEW_H
Makes a QTableView last column feel as if it was being resized from its left border.
Definition: guiutil.h:227
Filter the transaction list according to pre-specified rules.
Widget showing the transaction list for a wallet, including a filter row.
WalletModel * model
void chooseWatchonly(int idx)
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)
GUIUtil::TableViewLastColumnResizingFixer * columnResizingFixer
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)
virtual void resizeEvent(QResizeEvent *event) 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 openThirdPartyTxUrl(QString url)
QAction * copyLabelAction
void doubleClicked(const QModelIndex &)
QLineEdit * amountWidget
Interface to Bitcoin wallet from Qt view code.
Definition: walletmodel.h:47
256-bit opaque blob.
Definition: uint256.h:127
const char * url
Definition: rpcconsole.cpp:52