BluezQt::DevicesModel Class

class BluezQt::DevicesModel

Model of all devices. More...

Header: #include <BluezQt/DevicesModel>
CMake: find_package(KF6 REQUIRED COMPONENTS BluezQt)
target_link_libraries(mytarget PRIVATE KF6::BluezQt)
Inherits: QAbstractListModel

Public Types

enum DeviceRoles { UbiRole, AddressRole, NameRole, FriendlyNameRole, RemoteNameRole, …, LastRole }

Public Functions

DevicesModel(BluezQt::Manager *manager, QObject *parent = nullptr)
BluezQt::DevicePtr device(const QModelIndex &index) const

Detailed Description

This class represents a model of all devices.

Example use in QML code:

import org.kde.bluezqt 1.0 as BluezQt

ListView {
    model: BluezQt.DevicesModel { }
    delegate: Text {
        text: "%1 (%2)".arg(Name).arg(Address)
    }
}

Member Type Documentation

enum DevicesModel::DeviceRoles

Device data roles.

ConstantValueDescription
BluezQt::DevicesModel::UbiRoleQt::UserRole + 100UBI of the device (QString).
BluezQt::DevicesModel::AddressRoleQt::UserRole + 101Address of the device (QString).
BluezQt::DevicesModel::NameRoleQt::UserRole + 102Name of the device (QString).
BluezQt::DevicesModel::FriendlyNameRoleQt::UserRole + 103Friendly name of the device (QString).
BluezQt::DevicesModel::RemoteNameRoleQt::UserRole + 104Remote name of the device (QString).
BluezQt::DevicesModel::ClassRoleQt::UserRole + 105Class of the device (quint32).
BluezQt::DevicesModel::TypeRoleQt::UserRole + 106Type of the device (Device::Type).
BluezQt::DevicesModel::AppearanceRoleQt::UserRole + 107Appearance of the device (quint16).
BluezQt::DevicesModel::IconRoleQt::UserRole + 108Icon name of the device (QString).
BluezQt::DevicesModel::PairedRoleQt::UserRole + 109Indicates whether the device is paired (bool).
BluezQt::DevicesModel::TrustedRoleQt::UserRole + 110Indicates whether the device is trusted (bool).
BluezQt::DevicesModel::BlockedRoleQt::UserRole + 111Indicates whether the device is blocked (bool).
BluezQt::DevicesModel::LegacyPairingRoleQt::UserRole + 112Indicates whether the device has legacy pairing (bool).
BluezQt::DevicesModel::RssiRoleQt::UserRole + 113Received Signal Strength Indicator of the device (qint16).
BluezQt::DevicesModel::ConnectedRoleQt::UserRole + 114Indicates whether the device is connected (bool).
BluezQt::DevicesModel::UuidsRoleQt::UserRole + 115UUIDs of supported services by the device (QStringList).
BluezQt::DevicesModel::ModaliasRoleQt::UserRole + 116Modalias of the device (QString).
BluezQt::DevicesModel::AdapterNameRoleQt::UserRole + 117Name of the associated adapter (QString).
BluezQt::DevicesModel::AdapterAddressRoleQt::UserRole + 118Address of the associated adapter (QString).
BluezQt::DevicesModel::AdapterPoweredRoleQt::UserRole + 119Indicates whether the associated adapter is powered (bool).
BluezQt::DevicesModel::AdapterDiscoverableRoleQt::UserRole + 120Indicates whether the associated adapter is discoverable (bool).
BluezQt::DevicesModel::AdapterPairableRoleQt::UserRole + 121Indicates whether the associated adapter is pairable (bool).
BluezQt::DevicesModel::AdapterDiscoveringRoleQt::UserRole + 122Indicates whether the associated adapter is discovering (bool).
BluezQt::DevicesModel::AdapterUuidsRoleQt::UserRole + 123UUIDs of supported services by the associated adapter (QStringList).
BluezQt::DevicesModel::LastRoleQt::UserRole + 124Last role used by DevicesModel.

Member Function Documentation

[explicit] DevicesModel::DevicesModel(BluezQt::Manager *manager, QObject *parent = nullptr)

Creates a new DevicesModel object using the given manager as a child of parent.

BluezQt::DevicePtr DevicesModel::device(const QModelIndex &index) const

Returns a device object for the specified index in the model.