From 191c0e300b8d625fa93939ecbff777469b816a44 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Thu, 4 Oct 2012 14:31:29 +0200 Subject: [PATCH] Fix a "warning: 'operator+=' is deprecated" when building with clang Any file including qstringbuilder.h would trigger a warning when compiled with QT_ASCII_CAST_WARNINGS defined since it implicitely converts a QString to QByteArray. Explicitely call toUtf8() to fix the issue. Change-Id: If20f9d4571c5d1ed789564196c9f1331e1efd1d9 Reviewed-by: Thiago Macieira --- src/corelib/tools/qstringbuilder.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/corelib/tools/qstringbuilder.h b/src/corelib/tools/qstringbuilder.h index 69ae301..a04910c 100644 --- a/src/corelib/tools/qstringbuilder.h +++ b/src/corelib/tools/qstringbuilder.h @@ -403,8 +403,7 @@ QByteArray &appendToByteArray(QByteArray &a, const QStringBuilder &b, char template QByteArray &appendToByteArray(QByteArray &a, const QStringBuilder &b, QChar) { - // append UTF-16 data to the byte array - return a += QString(b); + return a += QString(b).toUtf8(); } #endif } -- 2.7.4