summaryrefslogtreecommitdiffstats
path: root/examples/bluetooth/chat/qmlchat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/bluetooth/chat/qmlchat.cpp')
-rw-r--r--examples/bluetooth/chat/qmlchat.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/bluetooth/chat/qmlchat.cpp b/examples/bluetooth/chat/qmlchat.cpp
index aefc900a..6e23fe13 100644
--- a/examples/bluetooth/chat/qmlchat.cpp
+++ b/examples/bluetooth/chat/qmlchat.cpp
@@ -43,11 +43,17 @@
#include <QtQml/QQmlEngine>
#include <QtQml/QQmlContext>
#include <QDebug>
+#include <QBluetoothLocalDevice>
int main(int argc, char *argv[])
{
QGuiApplication application(argc, argv);
+ QList<QBluetoothHostInfo> infos = QBluetoothLocalDevice::allDevices();
+ if (infos.isEmpty())
+ qWarning() << "Missing Bluetooth local device. "
+ "Example will not work properly.";
+
const QString mainQmlApp = QLatin1String("qrc:/chat.qml");
QQuickView view;
view.setSource(QUrl(mainQmlApp));