summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2020-05-10 17:58:59 +0200
committerMarc Mutz <marc.mutz@kdab.com>2020-05-12 05:43:37 +0000
commit23849826b490c07d9ba656bcb4ac46edd3040c0a (patch)
tree5a96b82fda56c54b12eb6778839172b4853c2eef /src/plugins/platforms
parentb62bff2ef3a6c846462e5381664651f49944261a (diff)
Sweep of int-ish → char-ish types near calls to QString::fromU*()
The fromUtf16(ushort*) and fromUcs4(uint*) overloads are going to be deprecated. Use the newer fromUtf16(char16_t*) and fromUcs4(char32_t*) overloads. As a drive-by, use std::end()/std::size() where applicable. Change-Id: I5a93e38cae4a2e33d49c90d06c5f14f7cb7ce90c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiavalueprovider.cpp2
-rw-r--r--src/plugins/platforms/xcb/qxcbmime.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiavalueprovider.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiavalueprovider.cpp
index 8651bcff60..9b41162d45 100644
--- a/src/plugins/platforms/windows/uiautomation/qwindowsuiavalueprovider.cpp
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiavalueprovider.cpp
@@ -72,7 +72,7 @@ HRESULT STDMETHODCALLTYPE QWindowsUiaValueProvider::SetValue(LPCWSTR val)
return UIA_E_ELEMENTNOTAVAILABLE;
// First sets the value as a text.
- QString strVal = QString::fromUtf16(reinterpret_cast<const ushort *>(val));
+ QString strVal = QString::fromUtf16(reinterpret_cast<const char16_t *>(val));
accessible->setText(QAccessible::Value, strVal);
// Then, if the control supports the value interface (range value)
diff --git a/src/plugins/platforms/xcb/qxcbmime.cpp b/src/plugins/platforms/xcb/qxcbmime.cpp
index 6c5679135d..ec5ee7f994 100644
--- a/src/plugins/platforms/xcb/qxcbmime.cpp
+++ b/src/plugins/platforms/xcb/qxcbmime.cpp
@@ -192,7 +192,7 @@ QVariant QXcbMime::mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a,
if ((byte0 == 0xff && byte1 == 0xfe) || (byte0 == 0xfe && byte1 == 0xff)
|| (byte0 != 0 && byte1 == 0) || (byte0 == 0 && byte1 != 0)) {
const QString str = QString::fromUtf16(
- reinterpret_cast<const ushort *>(data.constData()), data.size() / 2);
+ reinterpret_cast<const char16_t *>(data.constData()), data.size() / 2);
if (!str.isNull()) {
if (format == QLatin1String("text/uri-list")) {
const auto urls = str.splitRef(QLatin1Char('\n'));