Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
PhosphorServiceBluetooth::BluetoothDeviceModel Class Reference

List model over a BluetoothHost's devices, optionally scoped to a single adapter. More...

#include <PhosphorServiceBluetooth/BluetoothDeviceModel.h>

Inheritance diagram for PhosphorServiceBluetooth::BluetoothDeviceModel:
[legend]

Public Types

enum  Roles {
  DeviceRole = Qt::UserRole + 1 , AddressRole , NameRole , AliasRole ,
  IconRole , PairedRole , TrustedRole , BlockedRole ,
  ConnectedRole , RssiRole , AdapterRole , UuidsRole
}

Signals

void hostChanged ()
void adapterChanged ()
void countChanged ()

Public Member Functions

 BluetoothDeviceModel (QObject *parent=nullptr)
 ~BluetoothDeviceModel () override
BluetoothHost * host () const
void setHost (BluetoothHost *host)
BluetoothAdapter * adapter () const
 Adapter filter.
void setAdapter (BluetoothAdapter *adapter)
int rowCount (const QModelIndex &parent={}) const override
QVariant data (const QModelIndex &index, int role) const override
QHash< int, QByteArray > roleNames () const override

Detailed Description

List model over a BluetoothHost's devices, optionally scoped to a single adapter.

Bind host, optionally set adapter to show only that adapter's devices (leave null for all), then drive a Repeater/ListView off the rows. The model keeps a local row mirror so its begin/end-insert/remove transactions always straddle the actual mutation.

Member Enumeration Documentation

◆ Roles

Enumerator
DeviceRole 
AddressRole 
NameRole 
AliasRole 
IconRole 
PairedRole 
TrustedRole 
BlockedRole 
ConnectedRole 
RssiRole 
AdapterRole 
UuidsRole 

Constructor & Destructor Documentation

◆ BluetoothDeviceModel()

PhosphorServiceBluetooth::BluetoothDeviceModel::BluetoothDeviceModel ( QObject * parent = nullptr)
explicit

◆ ~BluetoothDeviceModel()

PhosphorServiceBluetooth::BluetoothDeviceModel::~BluetoothDeviceModel ( )
override

Member Function Documentation

◆ adapter()

BluetoothAdapter * PhosphorServiceBluetooth::BluetoothDeviceModel::adapter ( ) const
nodiscard

Adapter filter.

Null shows every device across all adapters; non-null shows only devices whose adapter path matches it.

◆ adapterChanged

void PhosphorServiceBluetooth::BluetoothDeviceModel::adapterChanged ( )
signal

◆ countChanged

void PhosphorServiceBluetooth::BluetoothDeviceModel::countChanged ( )
signal

◆ data()

QVariant PhosphorServiceBluetooth::BluetoothDeviceModel::data ( const QModelIndex & index,
int role ) const
nodiscardoverride

◆ host()

BluetoothHost * PhosphorServiceBluetooth::BluetoothDeviceModel::host ( ) const
nodiscard

◆ hostChanged

void PhosphorServiceBluetooth::BluetoothDeviceModel::hostChanged ( )
signal

◆ roleNames()

QHash< int, QByteArray > PhosphorServiceBluetooth::BluetoothDeviceModel::roleNames ( ) const
nodiscardoverride

◆ rowCount()

int PhosphorServiceBluetooth::BluetoothDeviceModel::rowCount ( const QModelIndex & parent = {}) const
nodiscardoverride

◆ setAdapter()

void PhosphorServiceBluetooth::BluetoothDeviceModel::setAdapter ( BluetoothAdapter * adapter)

◆ setHost()

void PhosphorServiceBluetooth::BluetoothDeviceModel::setHost ( BluetoothHost * host)

The documentation for this class was generated from the following file: