Skip to content
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

Merged
merged 1 commit into from
Jun 15, 2022

Conversation

hebasto
Copy link
Member

@hebasto hebasto commented Jun 14, 2022

The TransactionOverviewWidget class was added in #176 as a header-only one.

Apparently, in upcoming CMake project, CMake AUTOMOC could be integrated better/simpler, if QObject-derived class implementation been placed into a source file.

From our Developer Notes:

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.

@DrahtBot
Copy link
Contributor

DrahtBot commented Jun 14, 2022

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

No conflicts as of last run.

Required for better/simpler interaction with CMake AUTOMOC.
@Sjors
Copy link
Member

Sjors commented Jun 14, 2022

tACK a50e0b1

Using a cpp file is consistent with other widgets we have.

Copy link
Contributor

@shaavan shaavan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK a50e0b1

  • I agree with the idea of transforming transactionoverviewwidget from a header-only file to having a separate cpp file to implement functions.
  • The code change and cpp implementation are cleanly implemented, with proper formatting.
  • I successfully ran the PR on Ubuntu 22.04 with Qt version 5.15.3.
  • Observed no functional difference between the master and this PR, showing that this is a pure refactor change.

@@ -5,11 +5,8 @@
#ifndef BITCOIN_QT_TRANSACTIONOVERVIEWWIDGET_H
#define BITCOIN_QT_TRANSACTIONOVERVIEWWIDGET_H

#include <qt/transactiontablemodel.h>

#include <QListView>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QListView is being included in both files now. Could remove it from here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From our Developer Notes:

Every .cpp and .h file should #include every header file it directly uses classes, functions or other definitions from, even if those headers are already included indirectly through other headers.

#include <qt/transactiontablemodel.h>

#include <QListView>
#include <QSize>
Copy link
Member

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.

@hebasto hebasto merged commit 26ec2f2 into bitcoin-core:master Jun 15, 2022
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jun 15, 2022
…cpp` source file

a50e0b1 qt, refactor: Add `transactionoverviewwidget.cpp` source file (Hennadii Stepanov)

Pull request description:

  The `TransactionOverviewWidget` class was added in bitcoin-core/gui#176 as a header-only one.

  Apparently, in upcoming [CMake project](hebasto#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
Copy link
Member

@jarolrod jarolrod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

post-merge ACK a50e0b1

@hebasto hebasto deleted the 220614-tow branch June 21, 2022 12:42
@bitcoin-core bitcoin-core locked and limited conversation to collaborators Jun 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants