refactor: Drop unneeded Q_DECLARE_METATYPE #61

pull hebasto wants to merge 1 commits into bitcoin-core:master from hebasto:200814-meta changing 2 files +6 −2
  1. hebasto commented at 12:49 pm on August 14, 2020: member

    Ported from https://github.com/bitcoin/bitcoin/pull/19108.

    For typedefs, which is CAmount, qRegisterMetaType(const char*) only is required.

    No behavior change.

  2. hebasto commented at 12:50 pm on August 14, 2020: member
    bitcoin/bitcoin#19108 has ACK from @promag.
  3. hebasto closed this on Aug 14, 2020

  4. hebasto reopened this on Aug 14, 2020

  5. MarcoFalke added the label Refactoring on Aug 26, 2020
  6. in src/qt/bitcoin.cpp:66 in 9657a8661b outdated
    60@@ -60,9 +61,10 @@ Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin);
    61 #endif
    62 #endif
    63 
    64-// Declare meta types used for QMetaObject::invokeMethod
    65+// Make types (not aliases) available to QVariant and other template-based Qt functions.
    66+// Additionally qRegisterMetaType() calls are required to make them available to
    67+// non-template based Qt functions, including those that use Qt::QueuedConnection.
    


    promag commented at 8:02 am on October 6, 2020:
    nit, could mention env QT_FATAL_WARNINGS=1 as a way to identify missing registrations.

    hebasto commented at 8:50 am on October 6, 2020:
    Thanks! Updated.
  7. qt, refactor: Drop unneeded Q_DECLARE_METATYPE
    For typedefs, which is CAmount, qRegisterMetaType(const char*) only is
    required.
    7c944086b3
  8. hebasto force-pushed on Oct 6, 2020
  9. hebasto commented at 8:50 am on October 6, 2020: member

    Updated 9657a8661be3e79a579b38893d58fc0a06f56bd9 -> 7c944086b3c62f9833fa9fbdbda2d5d4b34b37e9 (pr61.01 -> pr61.02, diff):

    nit, could mention env QT_FATAL_WARNINGS=1 as a way to identify missing registrations.

  10. hebasto commented at 9:09 am on October 6, 2020: member

    There was unanswered comment from @luke-jr:

    Is not needing it for typedefs considered defined behaviour?

    I think this excerpt from Qt docs is an answer:

    This [qRegisterMetaType] function is useful only for registering an alias (typedef)…

  11. luke-jr commented at 12:21 pm on October 6, 2020: member
    If there’s no behaviour change, I’d figure just leave it alone so things don’t subtly break if the type of CAmount were to ever be changed. Kinda the point of the typedef anyway is that you don’t need to care so much what the underlying type is…
  12. hebasto commented at 6:41 pm on October 6, 2020: member

    If there’s no behaviour change, I’d figure just leave it alone so things don’t subtly break if the type of CAmount were to ever be changed. Kinda the point of the typedef anyway is that you don’t need to care so much what the underlying type is…

    Closing.

  13. hebasto closed this on Oct 6, 2020

  14. promag commented at 8:11 am on October 7, 2020: contributor

    if the type of CAmount were to ever be changed

    Ok 😅

  15. bitcoin-core locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-22 03:20 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me