-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: Add transactionoverviewwidget.cpp
source file
#618
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// 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. | ||
|
||
#include <qt/transactionoverviewwidget.h> | ||
|
||
#include <qt/transactiontablemodel.h> | ||
|
||
#include <QListView> | ||
#include <QSize> | ||
#include <QSizePolicy> | ||
|
||
TransactionOverviewWidget::TransactionOverviewWidget(QWidget* parent) | ||
: QListView(parent) {} | ||
|
||
QSize TransactionOverviewWidget::sizeHint() const | ||
{ | ||
return {sizeHintForColumn(TransactionTableModel::ToAddress), QListView::sizeHint().height()}; | ||
} | ||
|
||
void TransactionOverviewWidget::showEvent(QShowEvent* event) | ||
{ | ||
Q_UNUSED(event); | ||
QSizePolicy sp = sizePolicy(); | ||
sp.setHorizontalPolicy(QSizePolicy::Minimum); | ||
setSizePolicy(sp); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,8 @@ | |
#ifndef BITCOIN_QT_TRANSACTIONOVERVIEWWIDGET_H | ||
#define BITCOIN_QT_TRANSACTIONOVERVIEWWIDGET_H | ||
|
||
#include <qt/transactiontablemodel.h> | ||
|
||
#include <QListView> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From our Developer Notes:
|
||
#include <QSize> | ||
#include <QSizePolicy> | ||
|
||
QT_BEGIN_NAMESPACE | ||
class QShowEvent; | ||
|
@@ -21,21 +18,11 @@ 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()}; | ||
} | ||
explicit TransactionOverviewWidget(QWidget* parent = nullptr); | ||
QSize sizeHint() const override; | ||
|
||
protected: | ||
void showEvent(QShowEvent* event) override | ||
{ | ||
Q_UNUSED(event); | ||
QSizePolicy sp = sizePolicy(); | ||
sp.setHorizontalPolicy(QSizePolicy::Minimum); | ||
setSizePolicy(sp); | ||
} | ||
void showEvent(QShowEvent* event) override; | ||
}; | ||
|
||
#endif // BITCOIN_QT_TRANSACTIONOVERVIEWWIDGET_H |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QSize
is included in the header file, could delete this line.