Bitcoin ABC  0.22.12
P2P Digital Currency
transactionview.cpp
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 #include <qt/transactionview.h>
6 
7 #include <node/ui_interface.h>
8 #include <qt/addresstablemodel.h>
9 #include <qt/bitcoinunits.h>
10 #include <qt/csvmodelwriter.h>
11 #include <qt/editaddressdialog.h>
12 #include <qt/optionsmodel.h>
13 #include <qt/platformstyle.h>
16 #include <qt/transactionrecord.h>
18 #include <qt/walletmodel.h>
19 
20 #include <QComboBox>
21 #include <QDateTimeEdit>
22 #include <QDesktopServices>
23 #include <QDoubleValidator>
24 #include <QHBoxLayout>
25 #include <QHeaderView>
26 #include <QLabel>
27 #include <QLineEdit>
28 #include <QMenu>
29 #include <QPoint>
30 #include <QScrollBar>
31 #include <QTableView>
32 #include <QTimer>
33 #include <QUrl>
34 #include <QVBoxLayout>
35 
37  QWidget *parent)
38  : QWidget(parent), model(nullptr), transactionProxyModel(nullptr),
39  transactionView(nullptr), abandonAction(nullptr),
40  columnResizingFixer(nullptr) {
41  // Build filter row
42  setContentsMargins(0, 0, 0, 0);
43 
44  QHBoxLayout *hlayout = new QHBoxLayout();
45  hlayout->setContentsMargins(0, 0, 0, 0);
46 
47  if (platformStyle->getUseExtraSpacing()) {
48  hlayout->setSpacing(5);
49  hlayout->addSpacing(26);
50  } else {
51  hlayout->setSpacing(0);
52  hlayout->addSpacing(23);
53  }
54 
55  watchOnlyWidget = new QComboBox(this);
56  watchOnlyWidget->setFixedWidth(24);
58  watchOnlyWidget->addItem(platformStyle->SingleColorIcon(":/icons/eye_plus"),
60  watchOnlyWidget->addItem(
61  platformStyle->SingleColorIcon(":/icons/eye_minus"), "",
63  hlayout->addWidget(watchOnlyWidget);
64 
65  dateWidget = new QComboBox(this);
66  if (platformStyle->getUseExtraSpacing()) {
67  dateWidget->setFixedWidth(121);
68  } else {
69  dateWidget->setFixedWidth(120);
70  }
71  dateWidget->addItem(tr("All"), All);
72  dateWidget->addItem(tr("Today"), Today);
73  dateWidget->addItem(tr("This week"), ThisWeek);
74  dateWidget->addItem(tr("This month"), ThisMonth);
75  dateWidget->addItem(tr("Last month"), LastMonth);
76  dateWidget->addItem(tr("This year"), ThisYear);
77  dateWidget->addItem(tr("Range..."), Range);
78  hlayout->addWidget(dateWidget);
79 
80  typeWidget = new QComboBox(this);
81  if (platformStyle->getUseExtraSpacing()) {
82  typeWidget->setFixedWidth(121);
83  } else {
84  typeWidget->setFixedWidth(120);
85  }
86 
87  typeWidget->addItem(tr("All"), TransactionFilterProxy::ALL_TYPES);
88  typeWidget->addItem(
89  tr("Received with"),
92  typeWidget->addItem(
93  tr("Sent to"),
96  typeWidget->addItem(tr("To yourself"), TransactionFilterProxy::TYPE(
98  typeWidget->addItem(tr("Mined"), TransactionFilterProxy::TYPE(
100  typeWidget->addItem(tr("Other"),
102 
103  hlayout->addWidget(typeWidget);
104 
105  search_widget = new QLineEdit(this);
106  search_widget->setPlaceholderText(
107  tr("Enter address, transaction id, or label to search"));
108  hlayout->addWidget(search_widget);
109 
110  amountWidget = new QLineEdit(this);
111  amountWidget->setPlaceholderText(tr("Min amount"));
112  if (platformStyle->getUseExtraSpacing()) {
113  amountWidget->setFixedWidth(97);
114  } else {
115  amountWidget->setFixedWidth(100);
116  }
117  QDoubleValidator *amountValidator = new QDoubleValidator(0, 1e20, 8, this);
118  QLocale amountLocale(QLocale::C);
119  amountLocale.setNumberOptions(QLocale::RejectGroupSeparator);
120  amountValidator->setLocale(amountLocale);
121  amountWidget->setValidator(amountValidator);
122  hlayout->addWidget(amountWidget);
123 
124  // Delay before filtering transactions in ms
125  static const int input_filter_delay = 200;
126 
127  QTimer *amount_typing_delay = new QTimer(this);
128  amount_typing_delay->setSingleShot(true);
129  amount_typing_delay->setInterval(input_filter_delay);
130 
131  QTimer *prefix_typing_delay = new QTimer(this);
132  prefix_typing_delay->setSingleShot(true);
133  prefix_typing_delay->setInterval(input_filter_delay);
134 
135  QVBoxLayout *vlayout = new QVBoxLayout(this);
136  vlayout->setContentsMargins(0, 0, 0, 0);
137  vlayout->setSpacing(0);
138 
139  QTableView *view = new QTableView(this);
140  vlayout->addLayout(hlayout);
141  vlayout->addWidget(createDateRangeWidget());
142  vlayout->addWidget(view);
143  vlayout->setSpacing(0);
144  int width = view->verticalScrollBar()->sizeHint().width();
145  // Cover scroll bar width with spacing
146  if (platformStyle->getUseExtraSpacing()) {
147  hlayout->addSpacing(width + 2);
148  } else {
149  hlayout->addSpacing(width);
150  }
151  // Always show scroll bar
152  view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
153  view->setTabKeyNavigation(false);
154  view->setContextMenuPolicy(Qt::CustomContextMenu);
155 
156  view->installEventFilter(this);
157 
158  transactionView = view;
159 
160  // Actions
161  abandonAction = new QAction(tr("Abandon transaction"), this);
162  QAction *copyAddressAction = new QAction(tr("Copy address"), this);
163  QAction *copyLabelAction = new QAction(tr("Copy label"), this);
164  QAction *copyAmountAction = new QAction(tr("Copy amount"), this);
165  QAction *copyTxIDAction = new QAction(tr("Copy transaction ID"), this);
166  QAction *copyTxHexAction = new QAction(tr("Copy raw transaction"), this);
167  QAction *copyTxPlainText =
168  new QAction(tr("Copy full transaction details"), this);
169  QAction *editLabelAction = new QAction(tr("Edit label"), this);
170  QAction *showDetailsAction =
171  new QAction(tr("Show transaction details"), this);
172 
173  contextMenu = new QMenu(this);
174  contextMenu->addAction(copyAddressAction);
175  contextMenu->addAction(copyLabelAction);
176  contextMenu->addAction(copyAmountAction);
177  contextMenu->addAction(copyTxIDAction);
178  contextMenu->addAction(copyTxHexAction);
179  contextMenu->addAction(copyTxPlainText);
180  contextMenu->addAction(showDetailsAction);
181  contextMenu->addSeparator();
182  contextMenu->addAction(abandonAction);
183  contextMenu->addAction(editLabelAction);
184 
185  connect(dateWidget,
186  static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this,
188  connect(typeWidget,
189  static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this,
191  connect(watchOnlyWidget,
192  static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this,
194  connect(amountWidget, &QLineEdit::textChanged, amount_typing_delay,
195  static_cast<void (QTimer::*)()>(&QTimer::start));
196  connect(amount_typing_delay, &QTimer::timeout, this,
198  connect(search_widget, &QLineEdit::textChanged, prefix_typing_delay,
199  static_cast<void (QTimer::*)()>(&QTimer::start));
200  connect(prefix_typing_delay, &QTimer::timeout, this,
202 
203  connect(view, &QTableView::doubleClicked, this,
205  connect(view, &QTableView::customContextMenuRequested, this,
207 
208  connect(abandonAction, &QAction::triggered, this,
210  connect(copyAddressAction, &QAction::triggered, this,
212  connect(copyLabelAction, &QAction::triggered, this,
214  connect(copyAmountAction, &QAction::triggered, this,
216  connect(copyTxIDAction, &QAction::triggered, this,
218  connect(copyTxHexAction, &QAction::triggered, this,
220  connect(copyTxPlainText, &QAction::triggered, this,
222  connect(editLabelAction, &QAction::triggered, this,
224  connect(showDetailsAction, &QAction::triggered, this,
226  // Double-clicking on a transaction on the transaction history page shows
227  // details
228  connect(this, &TransactionView::doubleClicked, this,
230 }
231 
233  this->model = _model;
234  if (_model) {
236  transactionProxyModel->setSourceModel(
237  _model->getTransactionTableModel());
238  transactionProxyModel->setDynamicSortFilter(true);
239  transactionProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
240  transactionProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
241 
242  transactionProxyModel->setSortRole(Qt::EditRole);
243 
244  transactionView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
246  transactionView->setAlternatingRowColors(true);
247  transactionView->setSelectionBehavior(QAbstractItemView::SelectRows);
248  transactionView->setSelectionMode(QAbstractItemView::ExtendedSelection);
249  transactionView->horizontalHeader()->setSortIndicator(
250  TransactionTableModel::Date, Qt::DescendingOrder);
251  transactionView->setSortingEnabled(true);
252  transactionView->verticalHeader()->hide();
253 
264 
267  this);
268 
269  if (_model->getOptionsModel()) {
270  // Add third party transaction URLs to context menu
271  QStringList listUrls = GUIUtil::splitSkipEmptyParts(
272  _model->getOptionsModel()->getThirdPartyTxUrls(), "|");
273  for (int i = 0; i < listUrls.size(); ++i) {
274  QString url = listUrls[i].trimmed();
275  QString host = QUrl(url, QUrl::StrictMode).host();
276  if (!host.isEmpty()) {
277  // use host as menu item label
278  QAction *thirdPartyTxUrlAction = new QAction(host, this);
279  if (i == 0) {
280  contextMenu->addSeparator();
281  }
282  contextMenu->addAction(thirdPartyTxUrlAction);
283  connect(thirdPartyTxUrlAction, &QAction::triggered,
284  [this, url] { openThirdPartyTxUrl(url); });
285  }
286  }
287  }
288 
289  // show/hide column Watch-only
291 
292  // Watch-only signal
293  connect(_model, &WalletModel::notifyWatchonlyChanged, this,
295  }
296 }
297 
299  if (!transactionProxyModel) {
300  return;
301  }
302 
303  const QDate currentDate = QDate::currentDate();
304 
305 #if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
306  const QDateTime startofDay = currentDate.startOfDay();
307 #else
308  const QDateTime startofDay = QDateTime(currentDate);
309 #endif
310  const QDateTime startOfWeek =
311  startofDay.addDays(-(currentDate.dayOfWeek() - 1));
312  const QDateTime startOfMonth = startofDay.addDays(-(currentDate.day() - 1));
313  const QDateTime startOfYear =
314  startofDay.addDays(-(currentDate.dayOfYear() - 1));
315 
316  dateRangeWidget->setVisible(false);
317  switch (dateWidget->itemData(idx).toInt()) {
318  case All:
322  break;
323  case Today:
326  break;
327  case ThisWeek: {
328  // Find last Monday
329 
331  startOfWeek, TransactionFilterProxy::MAX_DATE);
332 
333  } break;
334  case ThisMonth:
335 
337  startOfMonth, TransactionFilterProxy::MAX_DATE);
338  break;
339  case LastMonth:
340  transactionProxyModel->setDateRange(startOfMonth.addMonths(-1),
341  startOfMonth);
342  break;
343  case ThisYear:
344 
346  startOfYear, TransactionFilterProxy::MAX_DATE);
347  break;
348  case Range:
349  dateRangeWidget->setVisible(true);
351  break;
352  }
353 }
354 
356  if (!transactionProxyModel) {
357  return;
358  }
359 
360  transactionProxyModel->setTypeFilter(typeWidget->itemData(idx).toInt());
361 }
362 
364  if (!transactionProxyModel) {
365  return;
366  }
367 
369  static_cast<TransactionFilterProxy::WatchOnlyFilter>(
370  watchOnlyWidget->itemData(idx).toInt()));
371 }
372 
374  if (!transactionProxyModel) {
375  return;
376  }
377 
379 }
380 
382  if (!transactionProxyModel) {
383  return;
384  }
385 
386  Amount amount_parsed = Amount::zero();
388  amountWidget->text(), &amount_parsed)) {
389  transactionProxyModel->setMinAmount(amount_parsed);
390  } else {
392  }
393 }
394 
396  if (!model || !model->getOptionsModel()) {
397  return;
398  }
399 
400  // CSV is currently the only supported format
401  QString filename = GUIUtil::getSaveFileName(
402  this, tr("Export Transaction History"), QString(),
403  tr("Comma separated file (*.csv)"), nullptr);
404 
405  if (filename.isNull()) {
406  return;
407  }
408 
409  CSVModelWriter writer(filename);
410 
411  // name, column, role
413  writer.addColumn(tr("Confirmed"), 0, TransactionTableModel::ConfirmedRole);
414  if (model->wallet().haveWatchOnly()) {
415  writer.addColumn(tr("Watch-only"), TransactionTableModel::Watchonly);
416  }
417  writer.addColumn(tr("Date"), 0, TransactionTableModel::DateRole);
418  writer.addColumn(tr("Type"), TransactionTableModel::Type, Qt::EditRole);
419  writer.addColumn(tr("Label"), 0, TransactionTableModel::LabelRole);
420  writer.addColumn(tr("Address"), 0, TransactionTableModel::AddressRole);
424  writer.addColumn(tr("ID"), 0, TransactionTableModel::TxIDRole);
425 
426  if (!writer.write()) {
427  Q_EMIT message(tr("Exporting Failed"),
428  tr("There was an error trying to save the transaction "
429  "history to %1.")
430  .arg(filename),
432  } else {
433  Q_EMIT message(
434  tr("Exporting Successful"),
435  tr("The transaction history was successfully saved to %1.")
436  .arg(filename),
438  }
439 }
440 
441 void TransactionView::contextualMenu(const QPoint &point) {
442  QModelIndex index = transactionView->indexAt(point);
443  QModelIndexList selection =
444  transactionView->selectionModel()->selectedRows(0);
445  if (selection.empty()) {
446  return;
447  }
448 
449  // check if transaction can be abandoned, disable context menu action in
450  // case it doesn't
451  TxId txid;
452  txid.SetHex(selection.at(0)
454  .toString()
455  .toStdString());
456  abandonAction->setEnabled(model->wallet().transactionCanBeAbandoned(txid));
457 
458  if (index.isValid()) {
459  contextMenu->popup(transactionView->viewport()->mapToGlobal(point));
460  }
461 }
462 
464  if (!transactionView || !transactionView->selectionModel()) {
465  return;
466  }
467 
468  QModelIndexList selection =
469  transactionView->selectionModel()->selectedRows(0);
470 
471  // get the hash from the TxHashRole (QVariant / QString)
472  QString hashQStr =
473  selection.at(0).data(TransactionTableModel::TxHashRole).toString();
474 
475  TxId txid;
476  txid.SetHex(hashQStr.toStdString());
477 
478  // Abandon the wallet transaction over the walletModel
480 
481  // Update the table
483  false);
484 }
485 
489 }
490 
494 }
495 
499 }
500 
503 }
504 
508 }
509 
513 }
514 
516  if (!transactionView->selectionModel() || !model) {
517  return;
518  }
519 
520  QModelIndexList selection =
521  transactionView->selectionModel()->selectedRows();
522  if (!selection.isEmpty()) {
523  AddressTableModel *addressBook = model->getAddressTableModel();
524  if (!addressBook) {
525  return;
526  }
527 
528  QString address =
529  selection.at(0).data(TransactionTableModel::AddressRole).toString();
530  if (address.isEmpty()) {
531  // If this transaction has no associated address, exit
532  return;
533  }
534  // Is address in address book? Address book can miss address when a
535  // transaction is sent from outside the UI.
536  int idx = addressBook->lookupAddress(address);
537  if (idx != -1) {
538  // Edit sending / receiving address
539  QModelIndex modelIdx = addressBook->index(idx, 0, QModelIndex());
540  // Determine type of address, launch appropriate editor dialog type
541  QString type =
542  modelIdx.data(AddressTableModel::TypeRole).toString();
543 
547  this);
548  dlg.setModel(addressBook);
549  dlg.loadRow(idx);
550  dlg.exec();
551  } else {
552  // Add sending address
554  dlg.setModel(addressBook);
555  dlg.setAddress(address);
556  dlg.exec();
557  }
558  }
559 }
560 
562  if (!transactionView->selectionModel()) {
563  return;
564  }
565 
566  QModelIndexList selection =
567  transactionView->selectionModel()->selectedRows();
568  if (!selection.isEmpty()) {
569  TransactionDescDialog *dlg = new TransactionDescDialog(selection.at(0));
570  dlg->setAttribute(Qt::WA_DeleteOnClose);
571  dlg->show();
572  }
573 }
574 
576  if (!transactionView || !transactionView->selectionModel()) {
577  return;
578  }
579 
580  QModelIndexList selection =
581  transactionView->selectionModel()->selectedRows(0);
582  if (!selection.isEmpty()) {
583  QDesktopServices::openUrl(QUrl::fromUserInput(
584  url.replace("%s", selection.at(0)
586  .toString())));
587  }
588 }
589 
591  dateRangeWidget = new QFrame();
592  dateRangeWidget->setFrameStyle(QFrame::Panel | QFrame::Raised);
593  dateRangeWidget->setContentsMargins(1, 1, 1, 1);
594  QHBoxLayout *layout = new QHBoxLayout(dateRangeWidget);
595  layout->setContentsMargins(0, 0, 0, 0);
596  layout->addSpacing(23);
597  layout->addWidget(new QLabel(tr("Range:")));
598 
599  dateFrom = new QDateTimeEdit(this);
600  dateFrom->setDisplayFormat("dd/MM/yy");
601  dateFrom->setCalendarPopup(true);
602  dateFrom->setMinimumWidth(100);
603  dateFrom->setDate(QDate::currentDate().addDays(-7));
604  layout->addWidget(dateFrom);
605  layout->addWidget(new QLabel(tr("to")));
606 
607  dateTo = new QDateTimeEdit(this);
608  dateTo->setDisplayFormat("dd/MM/yy");
609  dateTo->setCalendarPopup(true);
610  dateTo->setMinimumWidth(100);
611  dateTo->setDate(QDate::currentDate());
612  layout->addWidget(dateTo);
613  layout->addStretch();
614 
615  // Hide by default
616  dateRangeWidget->setVisible(false);
617 
618  // Notify on change
619  connect(dateFrom, &QDateTimeEdit::dateChanged, this,
621  connect(dateTo, &QDateTimeEdit::dateChanged, this,
623 
624  return dateRangeWidget;
625 }
626 
628  if (!transactionProxyModel) {
629  return;
630  }
631 
632 #if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
633  const QDateTime rangeFrom = dateFrom->date().startOfDay();
634  const QDateTime rangeTo = dateTo->date().endOfDay();
635 #else
636  const QDateTime rangeFrom = QDateTime(dateFrom->date());
637  const QDateTime rangeTo = QDateTime(dateTo->date()).addDays(1);
638 #endif
639 
640  transactionProxyModel->setDateRange(rangeFrom, rangeTo);
641 }
642 
643 void TransactionView::focusTransaction(const QModelIndex &idx) {
644  if (!transactionProxyModel) {
645  return;
646  }
647 
648  QModelIndex targetIdx = transactionProxyModel->mapFromSource(idx);
649  transactionView->scrollTo(targetIdx);
650  transactionView->setCurrentIndex(targetIdx);
651  transactionView->setFocus();
652 }
653 
655  if (!transactionProxyModel) {
656  return;
657  }
658 
659  const QModelIndexList results =
660  this->model->getTransactionTableModel()->match(
661  this->model->getTransactionTableModel()->index(0, 0),
663  QString::fromStdString(txid.ToString()), -1);
664 
665  transactionView->setFocus();
666  transactionView->selectionModel()->clearSelection();
667  for (const QModelIndex &index : results) {
668  const QModelIndex targetIndex =
669  transactionProxyModel->mapFromSource(index);
670  transactionView->selectionModel()->select(
671  targetIndex,
672  QItemSelectionModel::Rows | QItemSelectionModel::Select);
673  // Called once per destination to ensure all results are in view, unless
674  // transactions are not ordered by (ascending or descending) date.
675  transactionView->scrollTo(targetIndex);
676  // scrollTo() does not scroll far enough the first time when
677  // transactions are ordered by ascending date.
678  if (index == results[0]) {
679  transactionView->scrollTo(targetIndex);
680  }
681  }
682 }
683 
684 // We override the virtual resizeEvent of the QWidget to adjust tables column
685 // sizes as the tables width is proportional to the dialogs width.
686 void TransactionView::resizeEvent(QResizeEvent *event) {
687  QWidget::resizeEvent(event);
689 }
690 
691 // Need to override default Ctrl+C action for amount as default behaviour is
692 // just to copy DisplayRole text
693 bool TransactionView::eventFilter(QObject *obj, QEvent *event) {
694  if (event->type() == QEvent::KeyPress) {
695  QKeyEvent *ke = static_cast<QKeyEvent *>(event);
696  if (ke->key() == Qt::Key_C &&
697  ke->modifiers().testFlag(Qt::ControlModifier)) {
700  return true;
701  }
702  }
703  return QWidget::eventFilter(obj, event);
704 }
705 
706 // show/hide column Watch-only
707 void TransactionView::updateWatchOnlyColumn(bool fHaveWatchOnly) {
708  watchOnlyWidget->setVisible(fHaveWatchOnly);
710  !fHaveWatchOnly);
711 }
QVariant data(const QModelIndex &index, int role) const override
void addColumn(const QString &title, int column, int role=Qt::EditRole)
void openThirdPartyTxUrl(QString url)
interfaces::Wallet & wallet() const
Definition: walletmodel.h:150
static constexpr Amount zero()
Definition: amount.h:35
QWidget * createDateRangeWidget()
int lookupAddress(const QString &address) const
QStringList splitSkipEmptyParts(const QString &s, const QString &separator)
Definition: guiutil.cpp:423
Dialog showing transaction details.
bool getUseExtraSpacing() const
Definition: platformstyle.h:21
QAction * abandonAction
void updateTransaction(const QString &hash, int status, bool showTransaction)
New transaction, or transaction changed status.
void focusTransaction(const QModelIndex &)
Definition: amount.h:17
void setTypeFilter(quint32 modes)
QIcon SingleColorIcon(const QString &filename) const
Colorize an icon (given filename) with the icon color.
virtual bool transactionCanBeAbandoned(const TxId &txid)=0
Return whether transaction can be abandoned.
QTableView * transactionView
AddressTableModel * getAddressTableModel()
Export a Qt table model to a CSV file.
Transaction data, hex-encoded.
TransactionTableModel * parent
void chooseWatchonly(int idx)
int getDisplayUnit() const
Definition: optionsmodel.h:96
*static QString getAmountColumnTitle(int unit)
Gets title for amount column including current display unit if optionsModel reference available...
static quint32 TYPE(int type)
QDateTimeEdit * dateTo
const char * url
Definition: rpcconsole.cpp:55
void setModel(AddressTableModel *model)
static const QDateTime MIN_DATE
Earliest date that can be represented (far in the past).
static const QDateTime MAX_DATE
Last date that can be represented (far in the future).
Whole transaction as plain text.
virtual bool abandonTransaction(const TxId &txid)=0
Abandon transaction.
void setDateRange(const QDateTime &from, const QDateTime &to)
void message(const QString &title, const QString &message, unsigned int style)
Fired when a message should be reported to the user.
void setMinAmount(const Amount minimum)
Makes a QTableView last column feel as if it was being resized from its left border.
Definition: guiutil.h:194
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
Date and time this transaction was created.
std::string ToString() const
Definition: uint256.h:74
void updateWatchOnlyColumn(bool fHaveWatchOnly)
TransactionTableModel * getTransactionTableModel()
bool eventFilter(QObject *obj, QEvent *event) override
void setWatchOnlyFilter(WatchOnlyFilter filter)
Qt model of the address book in the core.
TransactionFilterProxy * transactionProxyModel
QString getThirdPartyTxUrls() const
Definition: optionsmodel.h:97
QComboBox * watchOnlyWidget
256-bit opaque blob.
Definition: uint256.h:120
void chooseDate(int idx)
void setModel(const QAbstractItemModel *model)
void setModel(WalletModel *model)
QLineEdit * amountWidget
QComboBox * typeWidget
Filter the transaction list according to pre-specified rules.
void setAddress(const QString &address)
Interface to Bitcoin wallet from Qt view code.
Definition: walletmodel.h:47
A TxId is the identifier of a transaction.
Definition: txid.h:14
QString getSaveFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedSuffixOut)
Get save filename, mimics QFileDialog::getSaveFileName, except that it appends a default suffix when ...
Definition: guiutil.cpp:273
virtual void resizeEvent(QResizeEvent *event) override
static const QString Receive
Specifies receive address.
Dialog for editing an address and associated information.
virtual bool haveWatchOnly()=0
Return whether wallet has watch only keys.
QFrame * dateRangeWidget
void notifyWatchonlyChanged(bool fHaveWatchonly)
Label of address related to transaction.
static const quint32 ALL_TYPES
Type filter bit field (all types).
void setSearchString(const QString &)
TransactionView(const PlatformStyle *platformStyle, QWidget *parent=nullptr)
void contextualMenu(const QPoint &)
TransactionRecord * index(interfaces::Wallet &wallet, const int cur_num_blocks, const int idx)
Formatted amount, without brackets when unconfirmed.
static bool parse(int unit, const QString &value, Amount *val_out)
Parse string to coin amount.
void copyEntryData(QAbstractItemView *view, int column, int role)
Copy a field of the currently selected entry of a view to the clipboard.
Definition: guiutil.cpp:250
void chooseType(int idx)
GUIUtil::TableViewLastColumnResizingFixer * columnResizingFixer
QDateTimeEdit * dateFrom
void SetHex(const char *psz)
Definition: uint256.cpp:21
QModelIndex index(int row, int column, const QModelIndex &parent) const override
bool write()
Perform export of the model to CSV.
void doubleClicked(const QModelIndex &)
Type of address (Send or Receive)
WalletModel * model
OptionsModel * getOptionsModel()
Predefined combinations for certain default usage cases.
Definition: ui_interface.h:71
QComboBox * dateWidget
QLineEdit * search_widget