From 6abdbb65e59779af56ae25372a853efca19eac59 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 30 Jul 2020 17:14:34 +0200 Subject: Change QString::fromLatin1 and friends to use QByteArrayView Also adjust the QString constructor from QByteArray to ignore \0 characters in the string (and not terminate conversion there). [ChangeLog][QtCore][QString] Constructing a QString from a QByteArray will not stop at intermediate '\0' (null) characters in the string as in Qt 5, but will convert all characters in the byte array. Change-Id: I1f6bfefe76dfa9072b165903fec7aa4af1abd882 Reviewed-by: Thiago Macieira --- src/plugins/platforms/ios/qiosscreen.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm index 411f6ebf81..c7dbe43124 100644 --- a/src/plugins/platforms/ios/qiosscreen.mm +++ b/src/plugins/platforms/ios/qiosscreen.mm @@ -245,7 +245,7 @@ static QString deviceModelIdentifier() char value[size]; sysctlbyname(key, &value, &size, NULL, 0); - return QString::fromLatin1(value); + return QString::fromLatin1(QByteArrayView(value, qsizetype(size))); #endif } -- cgit v1.2.3