remoteselector.h Example File
btfiletransfer/remoteselector.h
#ifndef REMOTESELECTOR_H
#define REMOTESELECTOR_H
#include <QDialog>
#include <QPointer>
#include <qbluetoothuuid.h>
#include <qbluetoothserviceinfo.h>
#include <qbluetoothservicediscoveryagent.h>
#include <qbluetoothlocaldevice.h>
QT_FORWARD_DECLARE_CLASS(QModelIndex)
QT_FORWARD_DECLARE_CLASS(QTableWidgetItem)
QT_FORWARD_DECLARE_CLASS(QFile)
class pinDisplay;
QT_USE_NAMESPACE
namespace Ui {
class RemoteSelector;
}
class RemoteSelector : public QDialog
{
Q_OBJECT
public:
explicit RemoteSelector(QWidget *parent = 0);
~RemoteSelector();
void startDiscovery(const QBluetoothUuid &uuid);
QBluetoothServiceInfo service() const;
private:
Ui::RemoteSelector *ui;
QBluetoothServiceDiscoveryAgent *m_discoveryAgent;
QBluetoothServiceInfo m_service;
QMap<int, QBluetoothServiceInfo> m_discoveredServices;
QFile *m_file;
QBluetoothLocalDevice *m_localDevice;
QPointer<pinDisplay> m_pindisplay;
bool m_pairingError;
QString addressToName(const QBluetoothAddress &address);
public Q_SLOTS:
void startDiscovery();
private slots:
void serviceDiscovered(const QBluetoothServiceInfo &serviceInfo);
void discoveryFinished();
void on_refreshPB_clicked();
void on_fileSelectPB_clicked();
void on_sendButton_clicked();
void on_stopButton_clicked();
void pairingFinished(const QBluetoothAddress &address,QBluetoothLocalDevice::Pairing pairing);
void pairingError(QBluetoothLocalDevice::Error error);
void displayPin(const QBluetoothAddress &address, QString pin);
void displayConfirmation(const QBluetoothAddress &address, QString pin);
void displayConfReject();
void displayConfAccepted();
void on_remoteDevices_cellClicked(int row, int column);
void on_remoteDevices_itemChanged(QTableWidgetItem* item);
};
#endif // REMOTESELECTOR_H