summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/bluetooth/CMakeLists.txt1
-rw-r--r--examples/bluetooth/bluetooth.pro3
-rw-r--r--examples/bluetooth/btscanner/CMakeLists.txt53
-rw-r--r--examples/bluetooth/btscanner/Info.plist41
-rw-r--r--examples/bluetooth/btscanner/btscanner.pro24
-rw-r--r--examples/bluetooth/btscanner/device.cpp165
-rw-r--r--examples/bluetooth/btscanner/device.h46
-rw-r--r--examples/bluetooth/btscanner/device.ui118
-rw-r--r--examples/bluetooth/btscanner/doc/images/btscanner-example.pngbin112720 -> 0 bytes
-rw-r--r--examples/bluetooth/btscanner/doc/src/btscanner.qdoc17
-rw-r--r--examples/bluetooth/btscanner/main.cpp18
-rw-r--r--examples/bluetooth/btscanner/service.cpp64
-rw-r--r--examples/bluetooth/btscanner/service.h34
-rw-r--r--examples/bluetooth/btscanner/service.ui71
14 files changed, 1 insertions, 654 deletions
diff --git a/examples/bluetooth/CMakeLists.txt b/examples/bluetooth/CMakeLists.txt
index 309e4bbe..de0996cc 100644
--- a/examples/bluetooth/CMakeLists.txt
+++ b/examples/bluetooth/CMakeLists.txt
@@ -4,7 +4,6 @@
qt_internal_add_example(heartrate-server)
if(TARGET Qt::Widgets)
qt_internal_add_example(btchat)
- qt_internal_add_example(btscanner)
endif()
if(TARGET Qt::Quick)
qt_internal_add_example(pingpong)
diff --git a/examples/bluetooth/bluetooth.pro b/examples/bluetooth/bluetooth.pro
index 8145ab39..73b78477 100644
--- a/examples/bluetooth/bluetooth.pro
+++ b/examples/bluetooth/bluetooth.pro
@@ -3,8 +3,7 @@ TEMPLATE = subdirs
SUBDIRS += heartrate-server
qtHaveModule(widgets) {
- SUBDIRS += btchat \
- btscanner
+ SUBDIRS += btchat
}
qtHaveModule(quick): SUBDIRS += pingpong \
diff --git a/examples/bluetooth/btscanner/CMakeLists.txt b/examples/bluetooth/btscanner/CMakeLists.txt
deleted file mode 100644
index 758ac485..00000000
--- a/examples/bluetooth/btscanner/CMakeLists.txt
+++ /dev/null
@@ -1,53 +0,0 @@
-# Copyright (C) 2022 The Qt Company Ltd.
-# SPDX-License-Identifier: BSD-3-Clause
-
-cmake_minimum_required(VERSION 3.16)
-project(btscanner LANGUAGES CXX)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/bluetooth/btscanner")
-
-find_package(Qt6 REQUIRED COMPONENTS Bluetooth Core Widgets)
-
-qt_add_executable(btscanner
- device.cpp device.h device.ui
- main.cpp
- service.cpp service.h service.ui
-)
-
-set_target_properties(btscanner PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
-)
-
-if (APPLE)
- if (IOS)
- set_target_properties(btscanner PROPERTIES
- MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist"
- )
- else()
- # Using absolute path for shared plist files is a Ninja bug workaround
- get_filename_component(SHARED_PLIST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../shared ABSOLUTE)
- set_target_properties(btscanner PROPERTIES
- MACOSX_BUNDLE_INFO_PLIST "${SHARED_PLIST_DIR}/Info.cmake.macos.plist"
- )
- endif()
-endif()
-
-target_link_libraries(btscanner PUBLIC
- Qt::Bluetooth
- Qt::Core
- Qt::Widgets
-)
-
-install(TARGETS btscanner
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/bluetooth/btscanner/Info.plist b/examples/bluetooth/btscanner/Info.plist
deleted file mode 100644
index 49fd2191..00000000
--- a/examples/bluetooth/btscanner/Info.plist
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDisplayName</key>
- <string>${PRODUCT_NAME}</string>
- <key>CFBundleExecutable</key>
- <string>${EXECUTABLE_NAME}</string>
- <key>CFBundleIconFile</key>
- <string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
- <key>CFBundleIdentifier</key>
- <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>${PRODUCT_NAME}</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleShortVersionString</key>
- <string>${QMAKE_SHORT_VERSION}</string>
- <key>CFBundleSignature</key>
- <string>${QMAKE_PKGINFO_TYPEINFO}</string>
- <key>CFBundleVersion</key>
- <string>${QMAKE_FULL_VERSION}</string>
- <key>LSRequiresIPhoneOS</key>
- <true/>
- <key>MinimumOSVersion</key>
- <string>${IPHONEOS_DEPLOYMENT_TARGET}</string>
- <key>NSBluetoothAlwaysUsageDescription</key>
- <string>Qt's BT scanner wants to access your Bluetooth adapter!</string>
- <key>UILaunchStoryboardName</key>
- <string>LaunchScreen</string>
- <key>UISupportedInterfaceOrientations</key>
- <array>
- <string>UIInterfaceOrientationPortrait</string>
- <string>UIInterfaceOrientationPortraitUpsideDown</string>
- <string>UIInterfaceOrientationLandscapeLeft</string>
- <string>UIInterfaceOrientationLandscapeRight</string>
- </array>
-</dict>
-</plist>
diff --git a/examples/bluetooth/btscanner/btscanner.pro b/examples/bluetooth/btscanner/btscanner.pro
deleted file mode 100644
index ee781ff7..00000000
--- a/examples/bluetooth/btscanner/btscanner.pro
+++ /dev/null
@@ -1,24 +0,0 @@
-TARGET = btscanner
-
-QT = core bluetooth widgets
-requires(qtConfig(listwidget))
-TEMPLATE = app
-
-SOURCES = \
- main.cpp \
- device.cpp \
- service.cpp
-
-ios: QMAKE_INFO_PLIST = Info.plist
-macos: QMAKE_INFO_PLIST = ../shared/Info.qmake.macos.plist
-
-HEADERS = \
- device.h \
- service.h
-
-FORMS = \
- device.ui \
- service.ui
-
-target.path = $$[QT_INSTALL_EXAMPLES]/bluetooth/btscanner
-INSTALLS += target
diff --git a/examples/bluetooth/btscanner/device.cpp b/examples/bluetooth/btscanner/device.cpp
deleted file mode 100644
index 62f67124..00000000
--- a/examples/bluetooth/btscanner/device.cpp
+++ /dev/null
@@ -1,165 +0,0 @@
-// Copyright (C) 2021 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#include "device.h"
-#include "service.h"
-#include "ui_device.h"
-
-#include <qbluetoothaddress.h>
-#include <qbluetoothdevicediscoveryagent.h>
-#include <qbluetoothlocaldevice.h>
-
-#include <QMenu>
-#include <QDebug>
-
-static QColor colorForPairing(QBluetoothLocalDevice::Pairing pairing)
-{
- return pairing == QBluetoothLocalDevice::Paired
- || pairing == QBluetoothLocalDevice::AuthorizedPaired
- ? QColor(Qt::green) : QColor(Qt::red);
-}
-
-DeviceDiscoveryDialog::DeviceDiscoveryDialog(QWidget *parent) :
- QDialog(parent),
- localDevice(new QBluetoothLocalDevice),
- ui(new Ui_DeviceDiscovery)
-{
- ui->setupUi(this);
- ui->stopScan->setVisible(false);
-
- // In case of multiple Bluetooth adapters it is possible to set the adapter
- // to be used. Example code:
- //
- // QBluetoothAddress address("XX:XX:XX:XX:XX:XX");
- // discoveryAgent = new QBluetoothDeviceDiscoveryAgent(address);
-
- discoveryAgent = new QBluetoothDeviceDiscoveryAgent();
-
- connect(ui->scan, &QAbstractButton::clicked, this, &DeviceDiscoveryDialog::startScan);
- connect(ui->stopScan, &QAbstractButton::clicked, this, &DeviceDiscoveryDialog::stopScan);
-
- connect(discoveryAgent, &QBluetoothDeviceDiscoveryAgent::deviceDiscovered,
- this, &DeviceDiscoveryDialog::addDevice);
- connect(discoveryAgent, &QBluetoothDeviceDiscoveryAgent::finished,
- this, &DeviceDiscoveryDialog::scanFinished);
-
- connect(ui->list, &QListWidget::itemActivated,
- this, &DeviceDiscoveryDialog::itemActivated);
-
- connect(localDevice, &QBluetoothLocalDevice::hostModeStateChanged,
- this, &DeviceDiscoveryDialog::hostModeStateChanged);
-
- hostModeStateChanged(localDevice->hostMode());
- // add context menu for devices to be able to pair device
- ui->list->setContextMenuPolicy(Qt::CustomContextMenu);
- connect(ui->list, &QWidget::customContextMenuRequested,
- this, &DeviceDiscoveryDialog::displayPairingMenu);
- connect(localDevice, &QBluetoothLocalDevice::pairingFinished,
- this, &DeviceDiscoveryDialog::pairingDone);
-}
-
-DeviceDiscoveryDialog::~DeviceDiscoveryDialog()
-{
- delete discoveryAgent;
-}
-
-void DeviceDiscoveryDialog::addDevice(const QBluetoothDeviceInfo &info)
-{
- const QString label = info.address().toString() + u' ' + info.name();
- const auto items = ui->list->findItems(label, Qt::MatchExactly);
- if (items.isEmpty()) {
- QListWidgetItem *item = new QListWidgetItem(label);
- QBluetoothLocalDevice::Pairing pairingStatus = localDevice->pairingStatus(info.address());
- item->setForeground(colorForPairing(pairingStatus));
- ui->list->addItem(item);
- }
-}
-
-void DeviceDiscoveryDialog::startScan()
-{
- discoveryAgent->start();
- ui->scan->setVisible(false);
- ui->stopScan->setVisible(true);
-}
-
-void DeviceDiscoveryDialog::stopScan()
-{
- discoveryAgent->stop();
- scanFinished();
-}
-
-void DeviceDiscoveryDialog::scanFinished()
-{
- ui->scan->setVisible(true);
- ui->stopScan->setVisible(false);
-}
-
-void DeviceDiscoveryDialog::itemActivated(QListWidgetItem *item)
-{
- const QString text = item->text();
- const auto index = text.indexOf(' ');
- if (index == -1)
- return;
-
- QBluetoothAddress address(text.left(index));
- QString name(text.mid(index + 1));
-
- ServiceDiscoveryDialog d(name, address);
- d.exec();
-}
-
-void DeviceDiscoveryDialog::on_discoverable_clicked(bool clicked)
-{
- if (clicked)
- localDevice->setHostMode(QBluetoothLocalDevice::HostDiscoverable);
- else
- localDevice->setHostMode(QBluetoothLocalDevice::HostConnectable);
-}
-
-void DeviceDiscoveryDialog::on_power_clicked(bool clicked)
-{
- if (clicked)
- localDevice->powerOn();
- else
- localDevice->setHostMode(QBluetoothLocalDevice::HostPoweredOff);
-}
-
-void DeviceDiscoveryDialog::hostModeStateChanged(QBluetoothLocalDevice::HostMode mode)
-{
- ui->power->setChecked(mode != QBluetoothLocalDevice::HostPoweredOff);
- ui->discoverable->setChecked(mode == QBluetoothLocalDevice::HostDiscoverable);
-
- const bool on = mode != QBluetoothLocalDevice::HostPoweredOff;
- ui->scan->setEnabled(on);
- ui->discoverable->setEnabled(on);
-}
-void DeviceDiscoveryDialog::displayPairingMenu(const QPoint &pos)
-{
- if (ui->list->count() == 0)
- return;
- QMenu menu(this);
- QAction *pairAction = menu.addAction("Pair");
- QAction *removePairAction = menu.addAction("Remove Pairing");
- QAction *chosenAction = menu.exec(ui->list->viewport()->mapToGlobal(pos));
- QListWidgetItem *currentItem = ui->list->currentItem();
-
- QString text = currentItem->text();
- const auto index = text.indexOf(' ');
- if (index == -1)
- return;
-
- QBluetoothAddress address (text.left(index));
- if (chosenAction == pairAction) {
- localDevice->requestPairing(address, QBluetoothLocalDevice::Paired);
- } else if (chosenAction == removePairAction) {
- localDevice->requestPairing(address, QBluetoothLocalDevice::Unpaired);
- }
-}
-void DeviceDiscoveryDialog::pairingDone(const QBluetoothAddress &address,
- QBluetoothLocalDevice::Pairing pairing)
-{
- const auto items = ui->list->findItems(address.toString(), Qt::MatchContains);
- const QColor color = colorForPairing(pairing);
- for (auto *item : items)
- item->setForeground(color);
-}
diff --git a/examples/bluetooth/btscanner/device.h b/examples/bluetooth/btscanner/device.h
deleted file mode 100644
index f1161696..00000000
--- a/examples/bluetooth/btscanner/device.h
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright (C) 2021 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#ifndef DEVICE_H
-#define DEVICE_H
-
-#include <qbluetoothlocaldevice.h>
-
-#include <QDialog>
-
-QT_FORWARD_DECLARE_CLASS(QBluetoothDeviceDiscoveryAgent)
-QT_FORWARD_DECLARE_CLASS(QBluetoothDeviceInfo)
-QT_FORWARD_DECLARE_CLASS(QListWidgetItem)
-
-QT_FORWARD_DECLARE_CLASS(Ui_DeviceDiscovery)
-
-QT_USE_NAMESPACE
-
-class DeviceDiscoveryDialog : public QDialog
-{
- Q_OBJECT
-
-public:
- DeviceDiscoveryDialog(QWidget *parent = nullptr);
- ~DeviceDiscoveryDialog();
-
-public slots:
- void addDevice(const QBluetoothDeviceInfo&);
- void on_power_clicked(bool clicked);
- void on_discoverable_clicked(bool clicked);
- void displayPairingMenu(const QPoint &pos);
- void pairingDone(const QBluetoothAddress&, QBluetoothLocalDevice::Pairing);
-private slots:
- void startScan();
- void stopScan();
- void scanFinished();
- void itemActivated(QListWidgetItem *item);
- void hostModeStateChanged(QBluetoothLocalDevice::HostMode);
-
-private:
- QBluetoothDeviceDiscoveryAgent *discoveryAgent;
- QBluetoothLocalDevice *localDevice;
- Ui_DeviceDiscovery *ui;
-};
-
-#endif
diff --git a/examples/bluetooth/btscanner/device.ui b/examples/bluetooth/btscanner/device.ui
deleted file mode 100644
index fd86a358..00000000
--- a/examples/bluetooth/btscanner/device.ui
+++ /dev/null
@@ -1,118 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>DeviceDiscovery</class>
- <widget class="QDialog" name="DeviceDiscovery">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>400</width>
- <height>411</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Bluetooth Scanner</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QListWidget" name="list"/>
- </item>
- <item>
- <widget class="QGroupBox" name="groupBox">
- <property name="title">
- <string>Local Device</string>
- </property>
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <item>
- <widget class="QCheckBox" name="power">
- <property name="text">
- <string>Bluetooth Powered On</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QCheckBox" name="discoverable">
- <property name="text">
- <string>Discoverable</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <widget class="QPushButton" name="scan">
- <property name="text">
- <string>Scan</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="stopScan">
- <property name="text">
- <string>Stop scan</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="clear">
- <property name="text">
- <string>Clear</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="quit">
- <property name="text">
- <string>Quit</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections>
- <connection>
- <sender>quit</sender>
- <signal>clicked()</signal>
- <receiver>DeviceDiscovery</receiver>
- <slot>accept()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>323</x>
- <y>275</y>
- </hint>
- <hint type="destinationlabel">
- <x>396</x>
- <y>268</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>clear</sender>
- <signal>clicked()</signal>
- <receiver>list</receiver>
- <slot>clear()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>188</x>
- <y>276</y>
- </hint>
- <hint type="destinationlabel">
- <x>209</x>
- <y>172</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>
diff --git a/examples/bluetooth/btscanner/doc/images/btscanner-example.png b/examples/bluetooth/btscanner/doc/images/btscanner-example.png
deleted file mode 100644
index b28be84a..00000000
--- a/examples/bluetooth/btscanner/doc/images/btscanner-example.png
+++ /dev/null
Binary files differ
diff --git a/examples/bluetooth/btscanner/doc/src/btscanner.qdoc b/examples/bluetooth/btscanner/doc/src/btscanner.qdoc
deleted file mode 100644
index bae5cbde..00000000
--- a/examples/bluetooth/btscanner/doc/src/btscanner.qdoc
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright (C) 2017 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
-
-/*!
- \example btscanner
- \title Bluetooth Scanner Example
- \brief An example showing how to locate Bluetooth devices.
-
- An example showing how to locate Bluetooth devices.
-
- \image btscanner-example.png
-
- \include examples-run.qdocinc
-
- \sa {Qt Bluetooth}
-
-*/
diff --git a/examples/bluetooth/btscanner/main.cpp b/examples/bluetooth/btscanner/main.cpp
deleted file mode 100644
index f6d4bed6..00000000
--- a/examples/bluetooth/btscanner/main.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright (C) 2021 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#include "device.h"
-
-#include <QApplication>
-#include <QtCore/QLoggingCategory>
-
-int main(int argc, char *argv[])
-{
- // QLoggingCategory::setFilterRules(QStringLiteral("qt.bluetooth* = true"));
- QApplication app(argc, argv);
-
- DeviceDiscoveryDialog d;
- d.exec();
- return 0;
-}
-
diff --git a/examples/bluetooth/btscanner/service.cpp b/examples/bluetooth/btscanner/service.cpp
deleted file mode 100644
index 324e0208..00000000
--- a/examples/bluetooth/btscanner/service.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright (C) 2021 The Qt Company Ltd.
-// Copyright (C) 2013 BlackBerry Limited. All rights reserved.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#include "service.h"
-#include "ui_service.h"
-
-#include <qbluetoothaddress.h>
-#include <qbluetoothservicediscoveryagent.h>
-#include <qbluetoothserviceinfo.h>
-#include <qbluetoothlocaldevice.h>
-#include <qbluetoothuuid.h>
-
-
-ServiceDiscoveryDialog::ServiceDiscoveryDialog(const QString &name,
- const QBluetoothAddress &address, QWidget *parent)
-: QDialog(parent), ui(new Ui_ServiceDiscovery)
-{
- ui->setupUi(this);
-
- //Using default Bluetooth adapter
- QBluetoothLocalDevice localDevice;
- QBluetoothAddress adapterAddress = localDevice.address();
-
- // In case of multiple Bluetooth adapters it is possible to
- // set which adapter will be used by providing MAC Address.
- // Example code:
- //
- // QBluetoothAddress adapterAddress("XX:XX:XX:XX:XX:XX");
- // discoveryAgent = new QBluetoothServiceDiscoveryAgent(adapterAddress);
-
- discoveryAgent = new QBluetoothServiceDiscoveryAgent(adapterAddress);
-
- discoveryAgent->setRemoteAddress(address);
-
- setWindowTitle(name);
-
- connect(discoveryAgent, &QBluetoothServiceDiscoveryAgent::serviceDiscovered,
- this, &ServiceDiscoveryDialog::addService);
- connect(discoveryAgent, &QBluetoothServiceDiscoveryAgent::finished,
- ui->status, &QWidget::hide);
-
- discoveryAgent->start();
-}
-
-ServiceDiscoveryDialog::~ServiceDiscoveryDialog()
-{
- delete discoveryAgent;
- delete ui;
-}
-
-void ServiceDiscoveryDialog::addService(const QBluetoothServiceInfo &info)
-{
- if (info.serviceName().isEmpty())
- return;
-
- QString line = info.serviceName();
- if (!info.serviceDescription().isEmpty())
- line.append("\n\t" + info.serviceDescription());
- if (!info.serviceProvider().isEmpty())
- line.append("\n\t" + info.serviceProvider());
-
- ui->list->addItem(line);
-}
diff --git a/examples/bluetooth/btscanner/service.h b/examples/bluetooth/btscanner/service.h
deleted file mode 100644
index de7e802d..00000000
--- a/examples/bluetooth/btscanner/service.h
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright (C) 2021 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-
-#ifndef SERVICE_H
-#define SERVICE_H
-
-
-#include <QDialog>
-
-QT_FORWARD_DECLARE_CLASS(QBluetoothAddress)
-QT_FORWARD_DECLARE_CLASS(QBluetoothServiceInfo)
-QT_FORWARD_DECLARE_CLASS(QBluetoothServiceDiscoveryAgent)
-
-QT_FORWARD_DECLARE_CLASS(Ui_ServiceDiscovery)
-
-QT_USE_NAMESPACE
-
-class ServiceDiscoveryDialog : public QDialog
-{
- Q_OBJECT
-
-public:
- ServiceDiscoveryDialog(const QString &name, const QBluetoothAddress &address, QWidget *parent = nullptr);
- ~ServiceDiscoveryDialog();
-
-public slots:
- void addService(const QBluetoothServiceInfo&);
-
-private:
- QBluetoothServiceDiscoveryAgent *discoveryAgent;
- Ui_ServiceDiscovery *ui;
-};
-
-#endif
diff --git a/examples/bluetooth/btscanner/service.ui b/examples/bluetooth/btscanner/service.ui
deleted file mode 100644
index 4ca12ee0..00000000
--- a/examples/bluetooth/btscanner/service.ui
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>ServiceDiscovery</class>
- <widget class="QDialog" name="ServiceDiscovery">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>539</width>
- <height>486</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Available Services</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QListWidget" name="list"/>
- </item>
- <item>
- <widget class="QLabel" name="status">
- <property name="text">
- <string>Querying...</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QDialogButtonBox" name="buttonBox">
- <property name="standardButtons">
- <set>QDialogButtonBox::Close</set>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections>
- <connection>
- <sender>buttonBox</sender>
- <signal>accepted()</signal>
- <receiver>ServiceDiscovery</receiver>
- <slot>accept()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>396</x>
- <y>457</y>
- </hint>
- <hint type="destinationlabel">
- <x>535</x>
- <y>443</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>buttonBox</sender>
- <signal>rejected()</signal>
- <receiver>ServiceDiscovery</receiver>
- <slot>reject()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>339</x>
- <y>464</y>
- </hint>
- <hint type="destinationlabel">
- <x>535</x>
- <y>368</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>