You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d4d647f
Browse filesBrowse the repository at this point in the historyBrowse files
chore(generator): Replace deprecated use of "endl" with "Qt::endl"
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);
| ^~~~
```
0 commit comments