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: Fix deprecation warnings when building against Qt 5.15 #46

Merged
merged 5 commits into from
Nov 19, 2020

Conversation

hebasto
Copy link
Member

@hebasto hebasto commented Aug 9, 2020

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

@promag
Copy link
Contributor

promag commented Aug 9, 2020

Concept ACK.

@fanquake
Copy link
Member

Concept ACK

@hebasto
Copy link
Member Author

hebasto commented Aug 26, 2020

Rebased 354b2bd -> 705c1f0 (pr46.01 -> pr46.02) due to the conflict with #35.

@Sjors
Copy link
Member

Sjors commented Aug 28, 2020

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.

@hebasto
Copy link
Member Author

hebasto commented Sep 25, 2020

@vasild
As you mention these warnings in bitcoin/bitcoin#19716 (comment), mind looking into this PR?

Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

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

Tested ACK 705c1f0 on macos with Apple clang version 11.0.3 (clang-1103.0.32.62) and brew qt 5.15.1.

@jonasschnelli
Copy link
Contributor

utACK 705c1f0
Added 0.22 milestone.

@jonasschnelli jonasschnelli added this to the 0.22.0 milestone Oct 23, 2020
Copy link
Contributor

@maflcko maflcko left a comment

Choose a reason for hiding this comment

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

Concept aCK

#endif
}

QImage GetImage(const QLabel* label)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Could pass by reference?

Suggested change
QImage GetImage(const QLabel* label)
QImage GetImage(const QLabel& label)

@maflcko maflcko merged commit 0a267f4 into bitcoin-core:master Nov 19, 2020
@maflcko
Copy link
Contributor

maflcko commented Nov 19, 2020

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

  CXX      qt/libbitcoinqt_a-bantablemodel.o
In file included from qt/bantablemodel.cpp:5:
In file included from ./qt/bantablemodel.h:12:
In file included from /usr/include/qt5/QtCore/QAbstractTableModel:1:
/usr/include/qt5/QtCore/qabstractitemmodel.h:170:5: warning: 'metaObject' overrides a member function but is not marked 'override' [-Wsuggest-override]
    Q_OBJECT
    ^
/usr/include/qt5/QtCore/qobjectdefs.h:175:32: note: expanded from macro 'Q_OBJECT'
    virtual const QMetaObject *metaObject() const; \
                               ^
/usr/include/qt5/QtCore/qobject.h:129:5: note: overridden virtual function is here
    Q_OBJECT
    ^
/usr/include/qt5/QtCore/qobjectdefs.h:175:32: note: expanded from macro 'Q_OBJECT'
    virtual const QMetaObject *metaObject() const; \
                               ^

@hebasto
Copy link
Member Author

hebasto commented Nov 19, 2020

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
/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]
BOOST_HEADER_DEPRECATED("<boost/iterator/function_output_iterator.hpp>")
warning: 'NSUserNotification' is deprecated: first deprecated in macOS 11.0 - All NSUserNotifications API should be replaced with UserNotifications.frameworks API [-Wdeprecated-declarations]
  • and
qt/guiutil.cpp:70:37: warning: 'SystemLocaleShortDate' is deprecated: Use QLocale [-Wdeprecated-declarations]
    return date.date().toString(Qt::SystemLocaleShortDate) + QString(" ") + date.toString("hh:mm");
                                    ^
/usr/local/Cellar/qt/5.15.1/lib/QtCore.framework/Headers/qnamespace.h:1280:31: note: 'SystemLocaleShortDate' has been explicitly marked deprecated here
        SystemLocaleShortDate Q_DECL_ENUMERATOR_DEPRECATED_X("Use QLocale"),
                              ^
/usr/local/Cellar/qt/5.15.1/lib/QtCore.framework/Headers/qcompilerdetection.h:1161:45: note: expanded from macro 'Q_DECL_ENUMERATOR_DEPRECATED_X'
#  define Q_DECL_ENUMERATOR_DEPRECATED_X(x) Q_DECL_DEPRECATED_X(x)
                                            ^
/usr/local/Cellar/qt/5.15.1/lib/QtCore.framework/Headers/qcompilerdetection.h:675:55: note: expanded from macro 'Q_DECL_DEPRECATED_X'
#    define Q_DECL_DEPRECATED_X(text) attribute ((__deprecated__(text)))
                                                      ^
1 warning generated.

Not seening -Wsuggest-override warnings at all 🤷‍♂️

@hebasto hebasto deleted the 200809-depr branch November 19, 2020 19:43
@maflcko
Copy link
Contributor

maflcko commented Nov 19, 2020

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

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

sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Nov 19, 2020
jonasschnelli added a commit that referenced this pull request Dec 1, 2020
…Date

86b1ab6 refactor: Replace deprecated Qt::SystemLocale{Short,Long}Date (Hennadii Stepanov)

Pull request description:

  As all deprecated warning in Qt 5.15.0 were eliminated in #46, Qt 5.15.1 introduced another one that is fixed in this PR.

  Required for bitcoin/bitcoin#20182.

  Details in Qt docs:
  - https://doc.qt.io/qt-5/qdatetime.html#toString-1
  - https://doc.qt.io/qt-5/qdate.html#toString-1

ACKs for top commit:
  jarolrod:
    Tested ACK 86b1ab6 on MacOS 10.15.7 and Arch Linux both with Qt 5.15.1
  jonasschnelli:
    Tested ACK 86b1ab6

Tree-SHA512: 1dbba8ee70c895bf58317172a9901cdbe5503b1d6258f51caaae88d88d332d9fbd4697c995192d31e3618ddfd532c5f5881289b3af1184422e5a9263a1224115
apoelstra added a commit to apoelstra/elements that referenced this pull request Dec 3, 2020
gwillen pushed a commit to ElementsProject/elements that referenced this pull request Mar 23, 2021
fdoving added a commit to fdoving/Ravencoin that referenced this pull request May 15, 2021
    bitcoin-core/gui#46
    + some adjustments for Raven

    qt, refactor: Fix 'QDateTime is Deprecated' warnings.
    qt, refactor: Fix 'QFlags is deprecated' warnings
    qt, refactor: Fix 'split is deprecated' warnings
    qt, refactor: Fix 'buttonClicked is deprecated' warnings
fdoving added a commit to fdoving/Ravencoin that referenced this pull request May 15, 2021
    bitcoin-core/gui#46
    + some adjustments for Raven

    qt, refactor: Fix 'QDateTime is Deprecated' warnings.
    qt, refactor: Fix 'QFlags is deprecated' warnings
    qt, refactor: Fix 'split is deprecated' warnings
    qt, refactor: Fix 'buttonClicked is deprecated' warnings
fdoving added a commit to fdoving/Ravencoin that referenced this pull request May 15, 2021
    bitcoin-core/gui#46
    + some adjustments for Raven

    qt, refactor: Fix 'QDateTime is Deprecated' warnings.
    qt, refactor: Fix 'QFlags is deprecated' warnings
    qt, refactor: Fix 'split is deprecated' warnings
    qt, refactor: Fix 'buttonClicked is deprecated' warnings
hans-schmidt pushed a commit to RavenProject/Ravencoin that referenced this pull request May 20, 2021
* qt: Fix deprecation warnings when building against Qt 5.15

    bitcoin-core/gui#46
    + some adjustments for Raven

    qt, refactor: Fix 'QDateTime is Deprecated' warnings.
    qt, refactor: Fix 'QFlags is deprecated' warnings
    qt, refactor: Fix 'split is deprecated' warnings
    qt, refactor: Fix 'buttonClicked is deprecated' warnings

* qt, refactor: Use enum type as switch arguments

    backport from bitcoin

    qt, refactor: Use enum type as switch argument in TransactionTableModel
    qt, refactor: Use enum type as switch argument in PeerTableModel
    qt, refactor: Use enum type as switch argument in BanTableModel
    qt, refactor: Use enum type as switch argument in AddressTableModel

    bitcoin#1d5d832d5c045cbbe3a0f4aa8fc29e52ecadc182
    bitcoin#52f122c11f5ac40bc2f7e31cb4da0a79c842f08e
    bitcoin#a35223f1cdaf6918501faccac1ff94ebfd38c6f6
    bitcoin#ab8a747d1ced9f20ca32f9898418be70670da71a

* qt, refactor: utilitydialog shutdown window qflag

* qt, refactor: BanTableModel replace 0 with Qt::NoItemFlags

* qt, refactor: ravenamountfield, StepEnabled

* qt, refactor: OptionsModel replace qstring.split()

* qt, refactor: Fix 'pixmap is deprecated' warnings

    backport from bitcoin
    with adjustments for Raven

    bitcoin#fa5749c805878304c107bcae0ae5ffa401dc7c4d

* qt, refactor: PaymentServer qbytearray deprecation warnings

    remove check for qt < 5.0, we no longer support 4.x.
HyperPeek pushed a commit to RavenProject/Ravencoin that referenced this pull request May 21, 2021
* qt: Fix deprecation warnings when building against Qt 5.15

    bitcoin-core/gui#46
    + some adjustments for Raven

    qt, refactor: Fix 'QDateTime is Deprecated' warnings.
    qt, refactor: Fix 'QFlags is deprecated' warnings
    qt, refactor: Fix 'split is deprecated' warnings
    qt, refactor: Fix 'buttonClicked is deprecated' warnings

* qt, refactor: Use enum type as switch arguments

    backport from bitcoin

    qt, refactor: Use enum type as switch argument in TransactionTableModel
    qt, refactor: Use enum type as switch argument in PeerTableModel
    qt, refactor: Use enum type as switch argument in BanTableModel
    qt, refactor: Use enum type as switch argument in AddressTableModel

    bitcoin#1d5d832d5c045cbbe3a0f4aa8fc29e52ecadc182
    bitcoin#52f122c11f5ac40bc2f7e31cb4da0a79c842f08e
    bitcoin#a35223f1cdaf6918501faccac1ff94ebfd38c6f6
    bitcoin#ab8a747d1ced9f20ca32f9898418be70670da71a

* qt, refactor: utilitydialog shutdown window qflag

* qt, refactor: BanTableModel replace 0 with Qt::NoItemFlags

* qt, refactor: ravenamountfield, StepEnabled

* qt, refactor: OptionsModel replace qstring.split()

* qt, refactor: Fix 'pixmap is deprecated' warnings

    backport from bitcoin
    with adjustments for Raven

    bitcoin#fa5749c805878304c107bcae0ae5ffa401dc7c4d

* qt, refactor: PaymentServer qbytearray deprecation warnings

    remove check for qt < 5.0, we no longer support 4.x.
fanquake added a commit that referenced this pull request Oct 20, 2021
a44caf65fe Merge bitcoin-core/univalue-subtree#28: Import fixes for sanitizer reported issues
135254331e Import fixes for sanitizer reported issues
d5fb86940e refactor: use c++11 range based for loop in checkObject
ff9c379304 refactor: Use nullptr (c++11) instead of NULL
08a99754d5 build: use ax_cxx_compile_stdcxx.m4 to check for C++11 support
66d3713ce7 Merge bitcoin-core/univalue-subtree#29: ci: travis -> cirrus
808d487292 ci: travis -> cirrus
c390ac375f Merge bitcoin-core/univalue-subtree#19: Split sources for easier buildsystem integration
4a5b0a1c65 build: Move source entries out to sources.mk
6c7d94b33c build: cleanup wonky gen usage
a222637c6d Merge #23: Merge changes from jgarzik/univalue@1ae6a23
f77d0f718d Merge commit '1ae6a231a0169938eb3972c1d48dd17cba5947e1' into HEAD
1ae6a231a0 Merge pull request #57 from MarcoFalke/test_fix
92bdd11f0b univalue_write: remove unneeded sstream.h include
ffb621c130 Merge pull request #56 from drodil/remove_sstream_header
f33acf9fe8 Merge commit '7890db9~' into HEAD
66e0adec4d Remove unnecessary sstream header from univalue.h
88967f6586 Version 1.0.4
1dc113dbef Merge pull request #50 from luke-jr/pushKV_bool
72392fb227 [tests] test pushKV for boolean values
c23132bcf4 Pushing boolean value to univalue correctly
81faab26a1 Merge pull request #48 from fwolfst/47-UPDATE_MIT_LINK_TO_HTTPS
b17634ef24 Update URLs to MIT license.
88ab64f6b5 Merge pull request #46 from jasonbcox/master
35ed96da31 Merge pull request #44 from MarcoFalke/Mf1709-univalue-cherrypick-explicit
420c226290 Merge pull request #45 from MarcoFalke/Mf1710-univalue-revert-test

git-subtree-dir: src/univalue
git-subtree-split: a44caf65fe55b9dd8ddb08f04c0f70409efd53b3
@bitcoin-core bitcoin-core locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecation warnings when building against Qt 5.15
7 participants