diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index a8409346bad03eae093b05afd9414ffd2e21a042..5c8c1d58ebe97bcfaad7d112807c5c928f76297d 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -1264,7 +1264,7 @@ QGLFormat::OpenGLVersionFlags Q_AUTOTEST_EXPORT qOpenGLVersionFlagsFromString(co
     QGLFormat::OpenGLVersionFlags versionFlags = QGLFormat::OpenGL_Version_None;
 
     if (versionString.startsWith(QLatin1String("OpenGL ES"))) {
-        QStringList parts = versionString.split(QLatin1Char(' '));
+        const auto parts = versionString.splitRef(QLatin1Char(' '));
         if (parts.size() >= 3) {
             if (parts[2].startsWith(QLatin1String("1."))) {
                 if (parts[1].endsWith(QLatin1String("-CM"))) {
diff --git a/src/platformsupport/devicediscovery/qdevicediscovery_udev.cpp b/src/platformsupport/devicediscovery/qdevicediscovery_udev.cpp
index b2e16a409ac3cc9f8dcf54c12309441c8fb12139..f601a196ca10768aa4704a08cf68bd1457caf690 100644
--- a/src/platformsupport/devicediscovery/qdevicediscovery_udev.cpp
+++ b/src/platformsupport/devicediscovery/qdevicediscovery_udev.cpp
@@ -215,8 +215,8 @@ bool QDeviceDiscoveryUDev::checkDeviceType(udev_device *dev)
         return false;
 
     if ((m_types & Device_Keyboard) && (qstrcmp(udev_device_get_property_value(dev, "ID_INPUT_KEYBOARD"), "1") == 0 )) {
-        const char *capabilities_key = udev_device_get_sysattr_value(dev, "capabilities/key");
-        QStringList val = QString::fromUtf8(capabilities_key).split(QLatin1Char(' '), QString::SkipEmptyParts);
+        const QString capabilities_key = QString::fromUtf8(udev_device_get_sysattr_value(dev, "capabilities/key"));
+        const auto val = capabilities_key.splitRef(QLatin1Char(' '), QString::SkipEmptyParts);
         if (!val.isEmpty()) {
             bool ok;
             unsigned long long keys = val.last().toULongLong(&ok, 16);
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
index 150445f520bc538913d607ce26b66c3ad4e4ae12..36de1e0c69504e68ddef8b3bd55fc38aa9e7b328 100644
--- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
+++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
@@ -101,10 +101,10 @@ QEvdevKeyboardHandler *QEvdevKeyboardHandler::create(const QString &device,
     bool enableCompose = false;
     int grab = 0;
 
-    QStringList args = specification.split(QLatin1Char(':'));
-    foreach (const QString &arg, args) {
+    const auto args = specification.splitRef(QLatin1Char(':'));
+    for (const QStringRef &arg : args) {
         if (arg.startsWith(QLatin1String("keymap=")))
-            keymapFile = arg.mid(7);
+            keymapFile = arg.mid(7).toString();
         else if (arg == QLatin1String("disable-zap"))
             disableZap = true;
         else if (arg == QLatin1String("enable-compose"))
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp
index 178578e5a2899ce0efcd0691a3ec99a7941a1746..ffe9f82325b8b5ef03a44228e1921372206bc078 100644
--- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp
+++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp
@@ -135,9 +135,10 @@ void QEvdevKeyboardManager::loadKeymap(const QString &file)
         // Restore the default, which is either the built-in keymap or
         // the one given in the plugin spec.
         QString keymapFromSpec;
-        foreach (const QString &arg, m_spec.split(QLatin1Char(':'))) {
+        const auto specs = m_spec.splitRef(QLatin1Char(':'));
+        for (const QStringRef &arg : specs) {
             if (arg.startsWith(QLatin1String("keymap=")))
-                keymapFromSpec = arg.mid(7);
+                keymapFromSpec = arg.mid(7).toString();
         }
         foreach (QEvdevKeyboardHandler *handler, m_keyboards) {
             if (keymapFromSpec.isEmpty())
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp b/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp
index 7f73a7ef94df35dca2a36cc808775cb742cf5438..382b9b1514868952cbb8643d8d5241ea8e764401 100644
--- a/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp
+++ b/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp
@@ -71,8 +71,8 @@ QEvdevMouseHandler *QEvdevMouseHandler::create(const QString &device, const QStr
     int grab = 0;
     bool abs = false;
 
-    QStringList args = specification.split(QLatin1Char(':'));
-    foreach (const QString &arg, args) {
+    const auto args = specification.splitRef(QLatin1Char(':'));
+    for (const QStringRef &arg : args) {
         if (arg == QLatin1String("nocompress"))
             compression = false;
         else if (arg.startsWith(QLatin1String("dejitter=")))
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
index 720b032ea525f07f737592fdf4197a4d94ded082..5e5c931c2c847c4d6e30ddc9404fe453986db422 100644
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
@@ -177,8 +177,9 @@ QStringList QGenericUnixTheme::xdgIconThemePaths()
     QString xdgDirString = QFile::decodeName(qgetenv("XDG_DATA_DIRS"));
     if (xdgDirString.isEmpty())
         xdgDirString = QLatin1String("/usr/local/share/:/usr/share/");
-    foreach (const QString &xdgDir, xdgDirString.split(QLatin1Char(':'))) {
-        const QFileInfo xdgIconsDir(xdgDir + QStringLiteral("/icons"));
+    const auto xdgDirs = xdgDirString.splitRef(QLatin1Char(':'));
+    for (const QStringRef &xdgDir : xdgDirs) {
+        const QFileInfo xdgIconsDir(xdgDir + QLatin1String("/icons"));
         if (xdgIconsDir.isDir())
             paths.append(xdgIconsDir.absoluteFilePath());
     }
@@ -626,7 +627,7 @@ public:
     {
         Q_ASSERT(!systemFont);
         const int split = gtkFontName.lastIndexOf(QChar::Space);
-        float size = gtkFontName.mid(split+1).toFloat();
+        float size = gtkFontName.midRef(split + 1).toFloat();
         QString fontName = gtkFontName.left(split);
 
         systemFont = new QFont(fontName, size);