summaryrefslogtreecommitdiffstats
path: root/tests/manual/sensor_explorer/explorer.cpp
diff options
context:
space:
mode:
authorJuha Vuolle <juha.vuolle@insta.fi>2021-06-07 09:27:50 +0300
committerJuha Vuolle <juha.vuolle@insta.fi>2021-06-08 07:23:57 +0300
commitae82c50ca7fd5e356a736467e660acd976ec2e25 (patch)
tree055a8b2ac02d9bb7e1668755c7ac79e074e22e19 /tests/manual/sensor_explorer/explorer.cpp
parenta17deb2390081107649b820d9838127880beedf4 (diff)
Replace Q_FOREACH with ranged for loops
Task-number: QTBUG-92505 Change-Id: I1e8334473c883f76285736f6a26138ea882f5351 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Diffstat (limited to 'tests/manual/sensor_explorer/explorer.cpp')
-rw-r--r--tests/manual/sensor_explorer/explorer.cpp9
1 files changed, 4 insertions, 5 deletions
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<qrangelist>();
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<qoutputrangelist>();
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();