-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge #618: refactor: Add
transactionoverviewwidget.cpp
source file
a50e0b1 qt, refactor: Add `transactionoverviewwidget.cpp` source file (Hennadii Stepanov) Pull request description: The `TransactionOverviewWidget` class was added in #176 as a header-only one. Apparently, in upcoming [CMake project](hebasto/bitcoin#3), CMake [AUTOMOC](https://cmake.org/cmake/help/latest/prop_tgt/AUTOMOC.html) could be integrated better/simpler, if `QObject`-derived class implementation been placed into a source file. From our [Developer Notes](https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#source-code-organization): > Implementation code should go into the `.cpp` file and not the `.h`, unless necessary due to template usage or when performance due to inlining is critical. ACKs for top commit: Sjors: tACK a50e0b1 shaavan: ACK a50e0b1 Tree-SHA512: 4707b6be1c5e794c4014475f826ac45ec833e472db11f12d29995f9c5a599ee98622ad54f0af72734b192144b626411c69acdafa0e6d1a390bdebfd7e570f377
- Loading branch information
Showing
4 changed files
with
32 additions
and
16 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
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); | ||
} |
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