summaryrefslogtreecommitdiffstats
path: root/examples/bluetooth/btchat
diff options
context:
space:
mode:
Diffstat (limited to 'examples/bluetooth/btchat')
-rw-r--r--examples/bluetooth/btchat/main.cpp1
-rw-r--r--examples/bluetooth/btchat/remoteselector.cpp10
2 files changed, 5 insertions, 6 deletions
diff --git a/examples/bluetooth/btchat/main.cpp b/examples/bluetooth/btchat/main.cpp
index 5c7bbf75..e728efd2 100644
--- a/examples/bluetooth/btchat/main.cpp
+++ b/examples/bluetooth/btchat/main.cpp
@@ -56,6 +56,7 @@
int main(int argc, char *argv[])
{
//QLoggingCategory::setFilterRules(QStringLiteral("qt.bluetooth* = true"));
+ QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(argc, argv);
Chat d;
diff --git a/examples/bluetooth/btchat/remoteselector.cpp b/examples/bluetooth/btchat/remoteselector.cpp
index 2bd1efcc..ec5d207c 100644
--- a/examples/bluetooth/btchat/remoteselector.cpp
+++ b/examples/bluetooth/btchat/remoteselector.cpp
@@ -114,17 +114,15 @@ void RemoteSelector::serviceDiscovered(const QBluetoothServiceInfo &serviceInfo)
<< serviceInfo.protocolServiceMultiplexer();
qDebug() << "\tRFCOMM server channel:" << serviceInfo.serverChannel();
#endif
- QMapIterator<QListWidgetItem *, QBluetoothServiceInfo> i(m_discoveredServices);
- while (i.hasNext()){
- i.next();
- if (serviceInfo.device().address() == i.value().device().address()){
+ const QBluetoothAddress address = serviceInfo.device().address();
+ for (const QBluetoothServiceInfo &info : qAsConst(m_discoveredServices)) {
+ if (info.device().address() == address)
return;
- }
}
QString remoteName;
if (serviceInfo.device().name().isEmpty())
- remoteName = serviceInfo.device().address().toString();
+ remoteName = address.toString();
else
remoteName = serviceInfo.device().name();