-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 build with Qt5.14 #5583
fix build with Qt5.14 #5583
Conversation
Qt 5.14 introduces serialisation/deserialisation for enum classes, this results in ambiguous templates between qdatastream.h and preferences.h. we specialize everything to workaround this.
You'd need to sign the CLA, else there's no chance for getting this PR merged, as far as I know. This seems related to https://musescore.org/en/node/299162, right? |
I can confirm that this PR solves https://musescore.org/en/node/299162 on a linux OS. |
Interesting,
But why doesn't it lead to warnings using Qt 5.9 or 5.12? Anyway, that change seems to be OK |
@Jojo-Schmitz It seems that one has to define add_compile_definitions(QT_DEPRECATED_WARNINGS) However, |
Strange then how @korli found those warnings? Or did they get enabled again and possible even by default for Qt 5.14.0? |
So QT_DEPRECATED_WARNINGS got changed to have no effect, but at the same time QT_NO_DEPRECATED_WARNINGS got introduced to surpress those? Confusing... |
Done!
It seems so. |
I understand that deprecation warnings become default. |
Thanks!
You could use that link in the PR description under "Resolves: (direct link to the issue)", even if it is not an issue but a forum article |
Thanks for the tip! |
{ | ||
return out << static_cast<int>(val); | ||
} | ||
|
||
template<typename T, typename std::enable_if<std::is_enum<T>::value>::type* = nullptr> | ||
inline QDataStream &operator>>(QDataStream &in, T &val) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did these templates prevent MuseScore from compiling? Could you please post the error message then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this seems to be because of these lines which were added in Qt 5.14:
https://github.com/qt/qtbase/blob/5.14.0/src/corelib/serialization/qdatastream.h#L387-L395
Actually Qt implementation of these operators seems to do the same but maybe it is indeed better to be explicit here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, Qt implementation of these operators seems to do the same but actually differs: the build fails with it. This would need investigation but changes would be more involved.
Resolves: https://musescore.org/en/node/299162
(short description of the changes and the motivation to make the changes)
Use "x" letter to fill the checkboxes below like [x]