1 #ifndef BLUETOOTHDEVICEMODEL_H
2 #define BLUETOOTHDEVICEMODEL_H
4 #include <QAbstractListModel>
5 #include "bluemanager.h"
6 #include "blueadapter.h"
7 #include "bluetoothdevice.h"
9 class BluetoothDeviceModel : public QAbstractListModel
13 explicit BluetoothDeviceModel(QObject *parent = 0);
17 name = Qt::UserRole + 1,
24 int columnCount(const QModelIndex &) const { return 1; }
25 int rowCount(const QModelIndex &parent = QModelIndex()) const;
26 QVariant data(const QModelIndex &index, int role) const;
28 void adapterAdded(QDBusObjectPath);
29 void adapterRemoved(QDBusObjectPath);
30 void deviceCreated(QDBusObjectPath);
31 void deviceRemoved(QDBusObjectPath);
33 QList<BluetoothDevice*> devices(){ return m_devices; }
36 OrgBluezManagerInterface *manager;
37 OrgBluezAdapterInterface *adapter;
38 QList<BluetoothDevice*> m_devices;
41 #endif // BLUETOOTHDEVICEMODEL_H