summaryrefslogtreecommitdiffstats
path: root/examples/bluetooth
diff options
context:
space:
mode:
Diffstat (limited to 'examples/bluetooth')
-rw-r--r--examples/bluetooth/btchat/chatserver.cpp2
-rw-r--r--examples/bluetooth/btchat/remoteselector.cpp2
-rw-r--r--examples/bluetooth/heartrate-game/devicefinder.cpp2
-rw-r--r--examples/bluetooth/lowenergyscanner/device.cpp4
4 files changed, 5 insertions, 5 deletions
diff --git a/examples/bluetooth/btchat/chatserver.cpp b/examples/bluetooth/btchat/chatserver.cpp
index d65bb87e..2e6c314d 100644
--- a/examples/bluetooth/btchat/chatserver.cpp
+++ b/examples/bluetooth/btchat/chatserver.cpp
@@ -109,7 +109,7 @@ void ChatServer::sendMessage(const QString &message)
{
QByteArray text = message.toUtf8() + '\n';
- for (QBluetoothSocket *socket : qAsConst(clientSockets))
+ for (QBluetoothSocket *socket : std::as_const(clientSockets))
socket->write(text);
}
//! [sendMessage]
diff --git a/examples/bluetooth/btchat/remoteselector.cpp b/examples/bluetooth/btchat/remoteselector.cpp
index d0e91509..5872cec5 100644
--- a/examples/bluetooth/btchat/remoteselector.cpp
+++ b/examples/bluetooth/btchat/remoteselector.cpp
@@ -68,7 +68,7 @@ void RemoteSelector::serviceDiscovered(const QBluetoothServiceInfo &serviceInfo)
qDebug() << "\tRFCOMM server channel:" << serviceInfo.serverChannel();
#endif
const QBluetoothAddress address = serviceInfo.device().address();
- for (const QBluetoothServiceInfo &info : qAsConst(m_discoveredServices)) {
+ for (const QBluetoothServiceInfo &info : std::as_const(m_discoveredServices)) {
if (info.device().address() == address)
return;
}
diff --git a/examples/bluetooth/heartrate-game/devicefinder.cpp b/examples/bluetooth/heartrate-game/devicefinder.cpp
index 54dbd2bb..1b29b443 100644
--- a/examples/bluetooth/heartrate-game/devicefinder.cpp
+++ b/examples/bluetooth/heartrate-game/devicefinder.cpp
@@ -104,7 +104,7 @@ void DeviceFinder::connectToService(const QString &address)
m_deviceDiscoveryAgent->stop();
DeviceInfo *currentDevice = nullptr;
- for (QObject *entry : qAsConst(m_devices)) {
+ for (QObject *entry : std::as_const(m_devices)) {
auto device = qobject_cast<DeviceInfo *>(entry);
if (device && device->getAddress() == address ) {
currentDevice = device;
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;