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
14QT_BEGIN_NAMESPACE
15class QShowEvent;
16class QWidget;
17QT_END_NAMESPACE
18
19class TransactionOverviewWidget : public QListView
20{
21 Q_OBJECT
22
23public:
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
31protected:
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
void showEvent(QShowEvent *event) override
TransactionOverviewWidget(QWidget *parent=nullptr)