Bitcoin Core  22.99.0
P2P Digital Currency
transactionoverviewwidget.h
Go to the documentation of this file.
1 // Copyright (c) 2021 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_TRANSACTIONOVERVIEWWIDGET_H
6 #define BITCOIN_QT_TRANSACTIONOVERVIEWWIDGET_H
7 
9 
10 #include <QListView>
11 #include <QSize>
12 #include <QSizePolicy>
13 
14 QT_BEGIN_NAMESPACE
15 class QShowEvent;
16 class QWidget;
17 QT_END_NAMESPACE
18 
19 class TransactionOverviewWidget : public QListView
20 {
21  Q_OBJECT
22 
23 public:
24  explicit TransactionOverviewWidget(QWidget* parent = nullptr) : QListView(parent) {}
25 
26  QSize sizeHint() const override
27  {
28  return {sizeHintForColumn(TransactionTableModel::ToAddress), QListView::sizeHint().height()};
29  }
30 
31 protected:
32  void showEvent(QShowEvent* event) override
33  {
34  Q_UNUSED(event);
35  QSizePolicy sp = sizePolicy();
36  sp.setHorizontalPolicy(QSizePolicy::Minimum);
37  setSizePolicy(sp);
38  }
39 };
40 
41 #endif // BITCOIN_QT_TRANSACTIONOVERVIEWWIDGET_H
TransactionOverviewWidget::sizeHint
QSize sizeHint() const override
Definition: transactionoverviewwidget.h:26
transactiontablemodel.h
TransactionOverviewWidget
Definition: transactionoverviewwidget.h:19
TransactionTableModel::ToAddress
@ ToAddress
Definition: transactiontablemodel.h:39
TransactionOverviewWidget::showEvent
void showEvent(QShowEvent *event) override
Definition: transactionoverviewwidget.h:32
TransactionOverviewWidget::TransactionOverviewWidget
TransactionOverviewWidget(QWidget *parent=nullptr)
Definition: transactionoverviewwidget.h:24