summaryrefslogtreecommitdiffstats
path: root/examples/sensors
diff options
context:
space:
mode:
authorJuha Vuolle <juha.vuolle@insta.fi>2022-09-30 10:23:45 +0300
committerJuha Vuolle <juha.vuolle@insta.fi>2022-10-04 08:11:52 +0300
commitc3a265592d7d4709998e5bf12d14a143aa0bf14f (patch)
treedf3fb44a6049105f1e062d62d0b52f6e407c0180 /examples/sensors
parenta83541566473ce7f362eced21d12ac245a28f431 (diff)
Change from count() to size() with Qt containers
As the preferred method. Potentially may be deprecated similar to QString/QByteArray Fixes: QTBUG-107068 Change-Id: I0cfc9d7f8e2e450849f1d22c5b98aa353748ecf6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Diffstat (limited to 'examples/sensors')
-rw-r--r--examples/sensors/sensor_explorer/sensormodels.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/sensors/sensor_explorer/sensormodels.cpp b/examples/sensors/sensor_explorer/sensormodels.cpp
index b0aa7189..f9ed4d90 100644
--- a/examples/sensors/sensor_explorer/sensormodels.cpp
+++ b/examples/sensors/sensor_explorer/sensormodels.cpp
@@ -20,7 +20,7 @@ QByteArray rangelistToByteArray(const qrangelist& list)
else
ranges << QString("%1-%2 Hz").arg(r.first).arg(r.second);
}
- if (ranges.count() > 0)
+ if (ranges.size() > 0)
return ranges.join(", ").toLatin1();
return "-";
}
@@ -31,7 +31,7 @@ QByteArray outputrangelistToByteArray(const qoutputrangelist& list)
for (const qoutputrange &r : list) {
ranges << QString("(%1, %2) += %3").arg(r.minimum).arg(r.maximum).arg(r.accuracy);
}
- if (ranges.count() > 0)
+ if (ranges.size() > 0)
return ranges.join(", ").toLatin1();
return "-";
}
@@ -71,7 +71,7 @@ void AvailableSensorsModel::loadSensors()
int AvailableSensorsModel::rowCount(const QModelIndex&) const
{
- return m_availableSensors.count();
+ return m_availableSensors.size();
}
//! [1]
@@ -85,7 +85,7 @@ QVariant AvailableSensorsModel::data(const QModelIndex &index, int role) const
QSensor* AvailableSensorsModel::get(int index) const
{
- if (index < 0 || index >= m_availableSensors.count())
+ if (index < 0 || index >= m_availableSensors.size())
return nullptr;
return m_availableSensors[index];
}
@@ -103,7 +103,7 @@ int SensorPropertyModel::rowCount(const QModelIndex&) const
{
if (!m_sensor)
return 0;
- return m_values.count();
+ return m_values.size();
}
int SensorPropertyModel::columnCount(const QModelIndex&) const