diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-07-30 17:14:34 +0200 |
---|---|---|
committer | MÃ¥rten Nordheim <marten.nordheim@qt.io> | 2020-10-05 10:12:04 +0200 |
commit | 6abdbb65e59779af56ae25372a853efca19eac59 (patch) | |
tree | 0addf2c97067395e845dd90739fddbe99f90bc68 /src/plugins/platforms/ios | |
parent | c09df7b57c1e4b25b5e20c63d2bab63d0d12dea0 (diff) |
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 <thiago.macieira@intel.com>
Diffstat (limited to 'src/plugins/platforms/ios')
-rw-r--r-- | src/plugins/platforms/ios/qiosscreen.mm | 2 |
1 files changed, 1 insertions, 1 deletions
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 } |