remoteselector.h Example File
btchat/remoteselector.h
#ifndef REMOTESELECTOR_H
#define REMOTESELECTOR_H
#include <QDialog>
#include <qbluetoothuuid.h>
#include <qbluetoothserviceinfo.h>
#include <qbluetoothservicediscoveryagent.h>
QT_FORWARD_DECLARE_CLASS(QModelIndex)
QT_FORWARD_DECLARE_CLASS(QListWidgetItem)
QT_USE_NAMESPACE
namespace Ui {
class RemoteSelector;
}
class RemoteSelector : public QDialog
{
Q_OBJECT
public:
explicit RemoteSelector(const QBluetoothAddress &localAdapter, QWidget *parent = 0);
~RemoteSelector();
void startDiscovery(const QBluetoothUuid &uuid);
void stopDiscovery();
QBluetoothServiceInfo service() const;
private:
Ui::RemoteSelector *ui;
QBluetoothServiceDiscoveryAgent *m_discoveryAgent;
QBluetoothServiceInfo m_service;
QMap<QListWidgetItem *, QBluetoothServiceInfo> m_discoveredServices;
private slots:
void serviceDiscovered(const QBluetoothServiceInfo &serviceInfo);
void discoveryFinished();
void on_remoteDevices_itemActivated(QListWidgetItem *item);
void on_cancelButton_clicked();
};
#endif // REMOTESELECTOR_H