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

Fix Deprecation warnings with Qt 5.15 (and 5.14) #5616

Merged
merged 1 commit into from Jun 6, 2020

Conversation

Jojo-Schmitz
Copy link
Contributor

@Jojo-Schmitz Jojo-Schmitz commented Jan 16, 2020

at least those that are backwards compatible to at least Qt 5.9.
There are several hundred such (MSVC) warnings (557 C4996 in MSVC 2017, 680 in MSVC 2019, plus 5 'empty' ones) resp. 716 warnings (-Wdeprecated-declarations in MinGW, more than MSVC, due to being build in DEBUG mode), this PR fixes all but 5 (MSVC 2017), 16 (MSVC 2019), 17 (MinGW) of those.
The remaining few seem to require the use of replacements that are not properly documented, possibly due to a Qt 5.15 documentation not being available yet (and/or don't work with Qt 5.9), at least I'm at a loss about what to do with them.

Here are the remaining ones (marked with ToDo comments for now):

Description File Line
'QDesktopWidget::availableGeometry': Use QGuiApplication::screens() framework\telemetry\widgets\telemetrypermissiondialog.cpp 38 
'QJsonDocument::fromBinaryData': Use CBOR format instead mscore\cloud\loginmanager.cpp 83, 202
'QJsonDocument::toBinaryData': Use CBOR format instead mscore\cloud\loginmanager.cpp 95, 187
'Qt::DefaultLocaleShortDate': Use QLocale libmscore\page.cpp 334, 342, 348, 354, 357, 362, 365
'QHelpEngineCore::linksForIdentifier': Use documentsForIdentifier() instead mscore\help.cpp 97, 143
'QButtonGroup::butonClicked': Use QButtonGroup::idClicked(int) instead mscore\prefsdialog.cpp 223
'QListMs::ElementType::toSet': Use QSet(list.begin(), list.end()) instead. inspectors\models\inspectorlistmodel.cpp 122

Hints how/whether to deal with those would be very welcome...

@Jojo-Schmitz Jojo-Schmitz changed the title Fix Deprecation warnings comming in Qt 5.15 Fix Deprecation warnings coming in Qt 5.15 Jan 23, 2020
awl/pitchlabel.cpp Outdated Show resolved Hide resolved
@Jojo-Schmitz Jojo-Schmitz changed the title Fix Deprecation warnings coming in Qt 5.15 Fix Deprecation warnings coming with Qt 5.15 Feb 10, 2020
libmscore/element.h Outdated Show resolved Hide resolved
mscore/magbox.cpp Outdated Show resolved Hide resolved
mscore/inspector/inspector_ambitus.ui Outdated Show resolved Hide resolved
mscore/importxml.cpp Outdated Show resolved Hide resolved
libmscore/element.h Outdated Show resolved Hide resolved
@@ -552,7 +552,7 @@ GridView {
// force not hiding palette cell if it is being dragged to a score
enabled: paletteCell.paletteDrag
target: mscore
onElementDraggedToScoreView: paletteCell.paletteDrag = false
function onElementDraggedToScoreView() { paletteCell.paletteDrag = false; }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can't detect any negative impact of this and the other similar changes to qml files in the PR on the AppVeyor Build using Qt 5.9

Copy link

Choose a reason for hiding this comment

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

"Cannot"?

Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this needed? This is intended to be a handler to existing signal, not a standalone function. I am not sure whether it will work so if declared with function keyword.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"Cannot"?

right, corrected

Why is this needed? This is intended to be a handler to existing signal, not a standalone function. I am not sure whether it will work so if declared with function keyword.

Well, as written, I'm not really sure what I'm doing here, but did exactly as that runtime warning told me to do, and it seems to work in Qt 5.15 as well as in 5.9.

Copy link
Contributor

Choose a reason for hiding this comment

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

What does that warning say?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Warning: qrc:/qml/palettes/Palette.qml:551:13: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo() { ... } (qrc:/qml/palettes/Palette.qml:551, )

@RobFog
Copy link

RobFog commented Apr 11, 2020

Ouch. Rebase needed…

@Jojo-Schmitz
Copy link
Contributor Author

done ;-)

@Jojo-Schmitz Jojo-Schmitz marked this pull request as draft April 11, 2020 10:19
@Jojo-Schmitz Jojo-Schmitz marked this pull request as ready for review April 14, 2020 13:34
@Jojo-Schmitz Jojo-Schmitz marked this pull request as draft April 14, 2020 13:36
@Jojo-Schmitz Jojo-Schmitz marked this pull request as ready for review April 17, 2020 11:11
@Jojo-Schmitz Jojo-Schmitz marked this pull request as draft April 17, 2020 11:18
@Jojo-Schmitz Jojo-Schmitz force-pushed the warnings branch 2 times, most recently from 8be7263 to 9901b15 Compare April 21, 2020 08:57
@Jojo-Schmitz Jojo-Schmitz force-pushed the warnings branch 2 times, most recently from 27e16d6 to 9077769 Compare May 7, 2020 11:35
@Jojo-Schmitz Jojo-Schmitz force-pushed the warnings branch 2 times, most recently from 9e7b3bf to d8368bb Compare May 20, 2020 15:31
@Jojo-Schmitz Jojo-Schmitz marked this pull request as ready for review May 29, 2020 11:00
@Jojo-Schmitz Jojo-Schmitz force-pushed the warnings branch 4 times, most recently from 70d8820 to 6a71eb2 Compare June 3, 2020 10:51
@Jojo-Schmitz Jojo-Schmitz changed the title Fix Deprecation warnings coming with Qt 5.15 Fix Deprecation warnings with Qt 5.15 (and 5.14) Jun 3, 2020
* fix 383 warnings C4996 (deprecated) with one single line change
* fix 5 'empty' warnings about invalid slots, not sure the remaining
slots serve any purpose though
* disable warnings C4127 and C4996 for thirdparty/google_analytics
* fix 30 warnings C4996 using the suggested alternatives available since
at least Qt 5.9, so won't break building against that
* change as requested in code review plus some more fixes using the same
idea
* fixing yet more warnings
* disable deprecation warnings in qoogle_analytics for MinGW too
although I believe maxOS and Linux may use those too. Easy to extend to
those, if need be.
* Fix qml runtime warnings exactly following the advice given by that
warning, but without really know what I'm doing here or whether that is
still backwards compatible to Qt 5.9.
* Use replacements as suggested, if available and no `endl` neded with
`qDebug()`
* fix 24 more
* 2 more
* 7 more (one only seen in DEBUG mode)
* Fix the `endl` warnings
* maybe more changes this way?
* Add all warnings C5999 or bigger to the ignore list for telemetry
with Qt 5.15 Beta 1 as avoiding only C26439, C26444,C 26452, C26495,
C26498, C26812 isn't possible
* fix 2 deprecation warning new with Qt 5.15 beta 1
* fix 4 new warnings and also Qt 5.12 builds, disable some dead code
* fix deprecation warnings new with Qt 5.15's MSVC 2019 integration and
revert some (`QNetworkReply::networkError()`) that Qt 5.15 beta 2
reverted too
* fix warning reg. obsolete operator < for QVariants
* revert changes needed prior to beta 3 And clarifying some earlier
changes
* mark ToDos
* fix warning reg QString()::null
* fix a 'regression' from a revert of an earlier change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants