From d8d9cf943f0bcaf7c5ed4b25c1c5d466110ee14a Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 7 Apr 2025 14:01:13 +0200 Subject: [PATCH] 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 (cherry picked from commit a9e2f5d0dc93bbc171b9c0d014f7b00c9e87a8f7) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit dc3659f70fd1fdf945503dc9fefd92081797b951) --- src/corelib/serialization/qtextstream.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/corelib/serialization/qtextstream.cpp b/src/corelib/serialization/qtextstream.cpp index 7b86caf633d..0dbbe04aadc 100644 --- a/src/corelib/serialization/qtextstream.cpp +++ b/src/corelib/serialization/qtextstream.cpp @@ -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