BluezQt 5.109.0
|
Model of all devices. More...
#include <BluezQt/DevicesModel>
Public Types | |
enum | DeviceRoles { UbiRole = Qt::UserRole + 100 , AddressRole = Qt::UserRole + 101 , NameRole = Qt::UserRole + 102 , FriendlyNameRole = Qt::UserRole + 103 , RemoteNameRole = Qt::UserRole + 104 , ClassRole = Qt::UserRole + 105 , TypeRole = Qt::UserRole + 106 , AppearanceRole = Qt::UserRole + 107 , IconRole = Qt::UserRole + 108 , PairedRole = Qt::UserRole + 109 , TrustedRole = Qt::UserRole + 110 , BlockedRole = Qt::UserRole + 111 , LegacyPairingRole = Qt::UserRole + 112 , RssiRole = Qt::UserRole + 113 , ConnectedRole = Qt::UserRole + 114 , UuidsRole = Qt::UserRole + 115 , ModaliasRole = Qt::UserRole + 116 , AdapterNameRole = Qt::UserRole + 117 , AdapterAddressRole = Qt::UserRole + 118 , AdapterPoweredRole = Qt::UserRole + 119 , AdapterDiscoverableRole = Qt::UserRole + 120 , AdapterPairableRole = Qt::UserRole + 121 , AdapterDiscoveringRole = Qt::UserRole + 122 , AdapterUuidsRole = Qt::UserRole + 123 , LastRole = Qt::UserRole + 124 } |
Device data roles. More... | |
Public Member Functions | |
DevicesModel (Manager *manager, QObject *parent=nullptr) | |
Creates a new DevicesModel object. | |
~DevicesModel () override | |
Destroys a DevicesModel object. | |
QVariant | data (const QModelIndex &index, int role) const override |
Reimplemented from QAbstractListModel::data() | |
DevicePtr | device (const QModelIndex &index) const |
Returns a device for specified index. | |
QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const override |
Reimplemented from QAbstractListModel::index() | |
QHash< int, QByteArray > | roleNames () const override |
Reimplemented from QAbstractListModel::roleNames() | |
int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
Reimplemented from QAbstractListModel::rowCount() | |
Model of all devices.
This class represents a model of all devices.
Example use in QML code:
Device data roles.
Enumerator | |
---|---|
UbiRole | UBI of the device (QString) |
AddressRole | Address of the device (QString) |
NameRole | Name of the device (QString) |
FriendlyNameRole | Friendly name of the device (QString) |
RemoteNameRole | Remote name of the device (QString) |
ClassRole | Class of the device (quint32) |
TypeRole | Type of the device (Device::Type) |
AppearanceRole | Appearance of the device (quint16) |
IconRole | Icon name of the device (QString) |
PairedRole | Indicates whether the device is paired (bool) |
TrustedRole | Indicates whether the device is trusted (bool) |
BlockedRole | Indicates whether the device is blocked (bool) |
LegacyPairingRole | Indicates whether the device has legacy pairing (bool) |
RssiRole | Received Signal Strength Indicator of the device (qint16) |
ConnectedRole | Indicates whether the device is connected (bool) |
UuidsRole | UUIDs of supported services by the device (QStringList) |
ModaliasRole | Modalias of the device (QString) |
AdapterNameRole | Name of the associated adapter (QString) |
AdapterAddressRole | Address of the associated adapter (QString) |
AdapterPoweredRole | Indicates whether the associated adapter is powered (bool) |
AdapterDiscoverableRole | Indicates whether the associated adapter is discoverable (bool) |
AdapterPairableRole | Indicates whether the associated adapter is pairable (bool) |
AdapterDiscoveringRole | Indicates whether the associated adapter is discovering (bool) |
AdapterUuidsRole | UUIDs of supported services by the associated adapter (QStringList) |
LastRole | Last role used by DevicesModel. |
|
explicit |
Creates a new DevicesModel object.
manager | manager to be used |
parent |
|
override |
Destroys a DevicesModel object.
|
override |
Reimplemented from QAbstractListModel::data()
DevicePtr BluezQt::DevicesModel::device | ( | const QModelIndex & | index | ) | const |
Returns a device for specified index.
index | index in model |
|
override |
Reimplemented from QAbstractListModel::index()
|
override |
Reimplemented from QAbstractListModel::roleNames()
|
override |
Reimplemented from QAbstractListModel::rowCount()