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

List model over a BrightnessHost's devices. More...

#include <PhosphorServiceBrightness/BrightnessDeviceModel.h>

Inheritance diagram for PhosphorServiceBrightness::BrightnessDeviceModel:
[legend]

Public Types

enum  Roles {
  DeviceRole = Qt::UserRole + 1 , IdRole , NameRole , KindRole ,
  BrightnessRole , MaxBrightnessRole , PercentageRole
}

Signals

void hostChanged ()
void countChanged ()

Public Member Functions

 BrightnessDeviceModel (QObject *parent=nullptr)
 ~BrightnessDeviceModel () override
BrightnessHost * host () const
void setHost (BrightnessHost *host)
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 BrightnessHost's devices.

Bind host, then drive a Repeater/ListView off the rows. Sysfs devices are present at bind time; external displays (DDC/CI) arrive asynchronously, so the model tracks the host's deviceAdded / deviceRemoved with insert/remove transactions, and forwards per-device brightness / percentage changes as dataChanged.

Member Enumeration Documentation

◆ Roles

Enumerator
DeviceRole 
IdRole 
NameRole 
KindRole 
BrightnessRole 
MaxBrightnessRole 
PercentageRole 

Constructor & Destructor Documentation

◆ BrightnessDeviceModel()

PhosphorServiceBrightness::BrightnessDeviceModel::BrightnessDeviceModel ( QObject * parent = nullptr)
explicit

◆ ~BrightnessDeviceModel()

PhosphorServiceBrightness::BrightnessDeviceModel::~BrightnessDeviceModel ( )
override

Member Function Documentation

◆ countChanged

void PhosphorServiceBrightness::BrightnessDeviceModel::countChanged ( )
signal

◆ data()

QVariant PhosphorServiceBrightness::BrightnessDeviceModel::data ( const QModelIndex & index,
int role ) const
nodiscardoverride

◆ host()

BrightnessHost * PhosphorServiceBrightness::BrightnessDeviceModel::host ( ) const
nodiscard

◆ hostChanged

void PhosphorServiceBrightness::BrightnessDeviceModel::hostChanged ( )
signal

◆ roleNames()

QHash< int, QByteArray > PhosphorServiceBrightness::BrightnessDeviceModel::roleNames ( ) const
nodiscardoverride

◆ rowCount()

int PhosphorServiceBrightness::BrightnessDeviceModel::rowCount ( const QModelIndex & parent = {}) const
nodiscardoverride

◆ setHost()

void PhosphorServiceBrightness::BrightnessDeviceModel::setHost ( BrightnessHost * host)

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