Port QTEXTSTREAM_DEBUG to modern QFlags

Its code was just casting to int, which no longer compiles.
Call toInt() on the fiag first.

Pick-to: 6.5
Change-Id: I74971f37841b44879cffdb480a173561798f8fa7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a9e2f5d0dc93bbc171b9c0d014f7b00c9e87a8f7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit dc3659f70fd1fdf945503dc9fefd92081797b951)
This commit is contained in:
Edward Welbourne 2025-04-07 14:01:13 +02:00 committed by Qt Cherry-pick Bot
parent 0eb9b9523e
commit d8d9cf943f

View File

@ -928,7 +928,7 @@ QTextStream::QTextStream(QString *string, OpenMode openMode)
{
#if defined (QTEXTSTREAM_DEBUG)
qDebug("QTextStream::QTextStream(QString *string == *%p, openMode = %d)",
string, int(openMode));
string, int(openMode.toInt()));
#endif
Q_D(QTextStream);
d->string = string;
@ -946,7 +946,7 @@ QTextStream::QTextStream(QByteArray *array, OpenMode openMode)
{
#if defined (QTEXTSTREAM_DEBUG)
qDebug("QTextStream::QTextStream(QByteArray *array == *%p, openMode = %d)",
array, int(openMode));
array, int(openMode.toInt()));
#endif
Q_D(QTextStream);
d->device = new QBuffer(array);
@ -973,7 +973,7 @@ QTextStream::QTextStream(const QByteArray &array, OpenMode openMode)
{
#if defined (QTEXTSTREAM_DEBUG)
qDebug("QTextStream::QTextStream(const QByteArray &array == *(%p), openMode = %d)",
&array, int(openMode));
&array, int(openMode.toInt()));
#endif
QBuffer *buffer = new QBuffer;
buffer->setData(array);
@ -1004,7 +1004,7 @@ QTextStream::QTextStream(FILE *fileHandle, OpenMode openMode)
{
#if defined (QTEXTSTREAM_DEBUG)
qDebug("QTextStream::QTextStream(FILE *fileHandle = %p, openMode = %d)",
fileHandle, int(openMode));
fileHandle, int(openMode.toInt()));
#endif
QFile *file = new QFile;
// Discarding the return value of open; even if it failed