summaryrefslogtreecommitdiffstats
path: root/examples/bluetooth/lowenergyscanner
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-11-11 16:26:04 +0100
committerMarc Mutz <marc.mutz@qt.io>2022-11-12 08:42:25 +0100
commit2f2e25c3beea21c14bb75b2f32b5ee4700759a89 (patch)
treeeff1132b9135642b076cec6796691f91bbd07188 /examples/bluetooth/lowenergyscanner
parentcad49b3be482b41f1ae43b5c9ce4d009a810240b (diff)
Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. This is a 6.4 re-run of the script we ran in dev, in order to avoid conflicts between the branches when cherry-picking. Change-Id: I5eca3df3179dfb2b2682c75a479ba9a4259cc703 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'examples/bluetooth/lowenergyscanner')
-rw-r--r--examples/bluetooth/lowenergyscanner/device.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/bluetooth/lowenergyscanner/device.cpp b/examples/bluetooth/lowenergyscanner/device.cpp
index d6540a2f..d645931c 100644
--- a/examples/bluetooth/lowenergyscanner/device.cpp
+++ b/examples/bluetooth/lowenergyscanner/device.cpp
@@ -106,7 +106,7 @@ void Device::scanServices(const QString &address)
{
// We need the current device for service discovery.
- for (auto d: qAsConst(devices)) {
+ for (auto d: std::as_const(devices)) {
if (auto device = qobject_cast<DeviceInfo *>(d)) {
if (device->getAddress() == address ) {
currentDevice.setDevice(device->getDevice());
@@ -187,7 +187,7 @@ void Device::serviceScanDone()
void Device::connectToService(const QString &uuid)
{
QLowEnergyService *service = nullptr;
- for (auto s: qAsConst(m_services)) {
+ for (auto s: std::as_const(m_services)) {
auto serviceInfo = qobject_cast<ServiceInfo *>(s);
if (!serviceInfo)
continue;