forked from ElementsProject/elements
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
qt: Add TransactionOverviewWidget class
Github-Pull: bitcoin-core/gui#176 Rebased-From: d439921 (cherry picked from commit b7086e6)
- Loading branch information
Showing
4 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright (c) 2021 The Bitcoin Core developers | ||
// Distributed under the MIT software license, see the accompanying | ||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
#ifndef BITCOIN_QT_TRANSACTIONOVERVIEWWIDGET_H | ||
#define BITCOIN_QT_TRANSACTIONOVERVIEWWIDGET_H | ||
|
||
#include <qt/transactiontablemodel.h> | ||
|
||
#include <QListView> | ||
#include <QSize> | ||
#include <QSizePolicy> | ||
|
||
QT_BEGIN_NAMESPACE | ||
class QShowEvent; | ||
class QWidget; | ||
QT_END_NAMESPACE | ||
|
||
class TransactionOverviewWidget : public QListView | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit TransactionOverviewWidget(QWidget* parent = nullptr) : QListView(parent) {} | ||
|
||
QSize sizeHint() const override | ||
{ | ||
return {sizeHintForColumn(TransactionTableModel::ToAddress), QListView::sizeHint().height()}; | ||
} | ||
|
||
protected: | ||
void showEvent(QShowEvent* event) override | ||
{ | ||
Q_UNUSED(event); | ||
QSizePolicy sp = sizePolicy(); | ||
sp.setHorizontalPolicy(QSizePolicy::Minimum); | ||
setSizePolicy(sp); | ||
} | ||
}; | ||
|
||
#endif // BITCOIN_QT_TRANSACTIONOVERVIEWWIDGET_H |