chore(generator): Replace deprecated use of "endl" with "Qt::endl"#321
Merged
usiems merged 1 commit intoMeVisLab:mainfrom Oct 27, 2025
Merged
Conversation
This changes the usage of the deprecated global `endl` with `Qt::endl` for compatibility with Qt 5.15.2 and above. The approach ensures that `Qt::endl` is used consistently across all versions of Qt by defining a namespaced alias for Qt versions below 5.14.0. This follows up on the approach introduced in d11fc4f ("Qt6: QTextStream compatibility (PR-120)", 2023-10-05) by explicitly using `Qt::endl` everywhere and by flipping the logic to have `Qt::endl` defined for Qt < 5.14.0 Warnings addressed: ``` /path/to/PythonQt/generator/typesystem.cpp: In function ‘QString formattedCodeHelper(QTextStream&, Indentor&, QStringList&)’: /path/to/PythonQt/generator/typesystem.cpp:1900:38: warning: ‘QTextStream& QTextStreamFunctions::endl(QTextStream&)’ is deprecated: Use Qt::endl [-Wdeprecated-declarations] 1900 | s << indentor << line << endl; | ^~~~ In file included from /path/to/Qt/5.15.2/gcc_64/include/QtCore/qdebug.h:49, from /path/to/Qt/5.15.2/gcc_64/include/QtCore/QDebug:1, from /path/to/PythonQt/generator/typesystem.h:49, from /path/to/PythonQt/generator/typesystem.cpp:42: /path/to/Qt/5.15.2/gcc_64/include/QtCore/qtextstream.h:293:75: note: declared here 293 | Q_CORE_EXPORT QT_DEPRECATED_VERSION_X(5, 15, "Use Qt::endl") QTextStream &endl(QTextStream &s); | ^~~~ ```
mrbean-bremen
approved these changes
Oct 27, 2025
Contributor
|
@mrbean-bremen Seems like a possible hiccup for the rockylinux CI build. May try retriggering the run to get it passing the check. |
Contributor
|
Yes, I have seen this. This same error happens from time to time, seems to be a problem with the archive. |
usiems
approved these changes
Oct 27, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This changes the usage of the deprecated global
endlwithQt::endlfor compatibility with Qt 5.15.2 and above. The approach ensures thatQt::endlis used consistently across all versions of Qt by defining a namespaced alias for Qt versions below 5.14.0.This follows up on the approach introduced in d11fc4f ("Qt6: QTextStream compatibility (PR-120)", 2023-10-05) by explicitly using
Qt::endleverywhere and by flipping the logic to haveQt::endldefined for Qt < 5.14.0Warnings addressed: