From ae82c50ca7fd5e356a736467e660acd976ec2e25 Mon Sep 17 00:00:00 2001 From: Juha Vuolle Date: Mon, 7 Jun 2021 09:27:50 +0300 Subject: Replace Q_FOREACH with ranged for loops Task-number: QTBUG-92505 Change-Id: I1e8334473c883f76285736f6a26138ea882f5351 Reviewed-by: Lorn Potter --- tests/manual/sensor_explorer/explorer.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'tests/manual/sensor_explorer/explorer.cpp') diff --git a/tests/manual/sensor_explorer/explorer.cpp b/tests/manual/sensor_explorer/explorer.cpp index d2a85f91..112829c7 100644 --- a/tests/manual/sensor_explorer/explorer.cpp +++ b/tests/manual/sensor_explorer/explorer.cpp @@ -62,9 +62,9 @@ void Explorer::loadSensors() // Clear out anything that's in there now ui.sensors->clear(); - foreach (const QByteArray &type, QSensor::sensorTypes()) { + for (const QByteArray &type : QSensor::sensorTypes()) { qDebug() << "Found type" << type; - foreach (const QByteArray &identifier, QSensor::sensorsForType(type)) { + for (const QByteArray &identifier : QSensor::sensorsForType(type)) { qDebug() << "Found identifier" << identifier; // Don't put in sensors we can't connect to QSensor sensor(type); @@ -231,7 +231,7 @@ void Explorer::loadSensorProperties() if (typeName == "qrangelist") { qrangelist rl = v.value(); QStringList out; - foreach (const qrange &r, rl) { + for (const qrange &r : rl) { if (r.first == r.second) out << QString("%1 Hz").arg(r.first); else @@ -241,9 +241,8 @@ void Explorer::loadSensorProperties() } else if (typeName == "qoutputrangelist") { qoutputrangelist rl = v.value(); QStringList out; - foreach (const qoutputrange &r, rl) { + for (const qoutputrange &r : rl) out << QString("(%1, %2) += %3").arg(r.minimum).arg(r.maximum).arg(r.accuracy); - } val = out.join(", "); } else { val = v.toString(); -- cgit v1.2.3