Skip to content

Conversation

@jcfr
Copy link
Contributor

@jcfr jcfr commented Oct 26, 2025

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);
      |                                                                           ^~~~

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);
      |                                                                           ^~~~
```
@jamesobutler
Copy link
Contributor

@mrbean-bremen Seems like a possible hiccup for the rockylinux CI build. May try retriggering the run to get it passing the check.

@mrbean-bremen
Copy link
Contributor

Yes, I have seen this. This same error happens from time to time, seems to be a problem with the archive.

@usiems usiems merged commit d4d647f into MeVisLab:main Oct 27, 2025
27 of 28 checks passed
@jcfr jcfr deleted the fix-deprecated-endl-replacement branch October 28, 2025 13:53
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.

4 participants