refactor: Fix deprecation warnings when building against Qt 5.15 #46

pull hebasto wants to merge 5 commits into bitcoin-core:master from hebasto:200809-depr changing 15 files +101 −25
  1. hebasto commented at 5:33 pm on August 9, 2020: member

    What’s New in Qt 5.15:

    To help preparing for the transition to Qt 6, numerous classes and member functions that will be removed from Qt 6.0 have been marked as deprecated in the Qt 5.15 release.

    Fixes #36

  2. promag commented at 11:28 pm on August 9, 2020: contributor
    Concept ACK.
  3. fanquake commented at 4:19 am on August 18, 2020: member
    Concept ACK
  4. DrahtBot added the label Needs rebase on Aug 26, 2020
  5. MarcoFalke added the label Refactoring on Aug 26, 2020
  6. qt, refactor: Fix 'QDateTime is deprecated' warnings b02264cb5d
  7. qt, refactor: Fix 'pixmap is deprecated' warnings fa5749c805
  8. qt, refactor: Fix 'QFlags is deprecated' warnings 8e12d69961
  9. qt, refactor: Fix 'split is deprecated' warnings c2f4e5ea1d
  10. qt, refactor: Fix 'buttonClicked is deprecated' warnings 705c1f0648
  11. hebasto force-pushed on Aug 26, 2020
  12. hebasto commented at 5:40 pm on August 26, 2020: member
    Rebased 354b2bd0568a62bd00c211d1286f62479da4820a -> 705c1f0648c72aa97e0ee699ff9a3da23fc9bd61 (pr46.01 -> pr46.02) due to the conflict with #35.
  13. DrahtBot removed the label Needs rebase on Aug 26, 2020
  14. Sjors commented at 12:35 pm on August 28, 2020: member
    As mentioned in #36 I don’t see any deprecation warnings on macOS with homebrew QT 5.15, but at least this change doesn’t introduce new issues for me.
  15. hebasto commented at 10:19 am on September 25, 2020: member
    @vasild As you mention these warnings in https://github.com/bitcoin/bitcoin/pull/19716#issuecomment-676290875, mind looking into this PR?
  16. promag commented at 11:03 am on September 25, 2020: contributor
    Tested ACK 705c1f0648c72aa97e0ee699ff9a3da23fc9bd61 on macos with Apple clang version 11.0.3 (clang-1103.0.32.62) and brew qt 5.15.1.
  17. jonasschnelli commented at 9:43 am on October 23, 2020: contributor
    utACK 705c1f0648c72aa97e0ee699ff9a3da23fc9bd61 Added 0.22 milestone.
  18. jonasschnelli added this to the milestone 0.22.0 on Oct 23, 2020
  19. in src/qt/guiutil.cpp:941 in 705c1f0648
    936+#else
    937+    return label->pixmap() != nullptr;
    938+#endif
    939+}
    940+
    941+QImage GetImage(const QLabel* label)
    


    MarcoFalke commented at 6:03 pm on November 19, 2020:

    nit: Could pass by reference?

    0QImage GetImage(const QLabel& label)
    
  20. MarcoFalke commented at 6:04 pm on November 19, 2020: contributor
    Concept aCK
  21. MarcoFalke merged this on Nov 19, 2020
  22. MarcoFalke closed this on Nov 19, 2020

  23. MarcoFalke commented at 6:10 pm on November 19, 2020: contributor

    btw, I am getting a ton of warnings like this one:

     0  CXX      qt/libbitcoinqt_a-bantablemodel.o
     1In file included from qt/bantablemodel.cpp:5:
     2In file included from ./qt/bantablemodel.h:12:
     3In file included from /usr/include/qt5/QtCore/QAbstractTableModel:1:
     4/usr/include/qt5/QtCore/qabstractitemmodel.h:170:5: warning: 'metaObject' overrides a member function but is not marked 'override' [-Wsuggest-override]
     5    Q_OBJECT
     6    ^
     7/usr/include/qt5/QtCore/qobjectdefs.h:175:32: note: expanded from macro 'Q_OBJECT'
     8    virtual const QMetaObject *metaObject() const; \
     9                               ^
    10/usr/include/qt5/QtCore/qobject.h:129:5: note: overridden virtual function is here
    11    Q_OBJECT
    12    ^
    13/usr/include/qt5/QtCore/qobjectdefs.h:175:32: note: expanded from macro 'Q_OBJECT'
    14    virtual const QMetaObject *metaObject() const; \
    15                               ^
    
  24. hebasto commented at 7:21 pm on November 19, 2020: member

    Compiling on macOS 11.0.1 Big Sur (20B29) + Qt 5.15.1 gives the following warnings now:

    • a load of -W#pragma-messages from boost 1.74.0
    0/usr/local/include/boost/function_output_iterator.hpp:14:1: warning: This header is deprecated. Use <boost/iterator/function_output_iterator.hpp> instead. [-W#pragma-messages]
    1BOOST_HEADER_DEPRECATED("<boost/iterator/function_output_iterator.hpp>")
    
    • three -Wdeprecated-declarations about deprecated NSUserNotification (see #112 and #114)
    0warning: 'NSUserNotification' is deprecated: first deprecated in macOS 11.0 - All NSUserNotifications API should be replaced with UserNotifications.frameworks API [-Wdeprecated-declarations]
    
    • and
     0qt/guiutil.cpp:70:37: warning: 'SystemLocaleShortDate' is deprecated: Use QLocale [-Wdeprecated-declarations]
     1    return date.date().toString(Qt::SystemLocaleShortDate) + QString(" ") + date.toString("hh:mm");
     2                                    ^
     3/usr/local/Cellar/qt/5.15.1/lib/QtCore.framework/Headers/qnamespace.h:1280:31: note: 'SystemLocaleShortDate' has been explicitly marked deprecated here
     4        SystemLocaleShortDate Q_DECL_ENUMERATOR_DEPRECATED_X("Use QLocale"),
     5                              ^
     6/usr/local/Cellar/qt/5.15.1/lib/QtCore.framework/Headers/qcompilerdetection.h:1161:45: note: expanded from macro 'Q_DECL_ENUMERATOR_DEPRECATED_X'
     7#  define Q_DECL_ENUMERATOR_DEPRECATED_X(x) Q_DECL_DEPRECATED_X(x)
     8                                            ^
     9/usr/local/Cellar/qt/5.15.1/lib/QtCore.framework/Headers/qcompilerdetection.h:675:55: note: expanded from macro 'Q_DECL_DEPRECATED_X'
    10#    define Q_DECL_DEPRECATED_X(text) attribute ((__deprecated__(text)))
    11                                                      ^
    121 warning generated.
    

    Not seening -Wsuggest-override warnings at all :man_shrugging:

  25. hebasto deleted the branch on Nov 19, 2020
  26. MarcoFalke commented at 7:56 pm on November 19, 2020: contributor

    Oh the override warnings happen with clang on linux. E.g fedora or debian:

    https://cirrus-ci.com/task/6217749342978048?command=make#L10798

  27. sidhujag referenced this in commit 4c94c5b119 on Nov 19, 2020
  28. jonasschnelli referenced this in commit f2a673f15b on Dec 1, 2020
  29. apoelstra referenced this in commit 20c7518e23 on Dec 3, 2020
  30. gwillen referenced this in commit d2e4f52b01 on Mar 23, 2021
  31. fdoving referenced this in commit 1ce6f29b35 on May 15, 2021
  32. fdoving referenced this in commit 62683f7871 on May 15, 2021
  33. fdoving referenced this in commit 1541dc32bd on May 15, 2021
  34. hans-schmidt referenced this in commit 41bd056acc on May 20, 2021
  35. HyperPeek referenced this in commit 9cf0e4bdf3 on May 21, 2021
  36. fanquake referenced this in commit 9b49ed656f on Oct 20, 2021
  37. 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-10-23 02:20 UTC

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