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

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

#include <PhosphorServiceNetwork/NetworkDeviceModel.h>

Inheritance diagram for PhosphorServiceNetwork::NetworkDeviceModel:
[legend]

Public Types

enum  Roles {
  DeviceRole = Qt::UserRole + 1 , InterfaceNameRole , DeviceTypeRole , StateRole ,
  ManagedRole
}

Signals

void hostChanged ()
void countChanged ()

Public Member Functions

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

Bind host, then drive a Repeater/ListView off the rows. The model owns a local row mirror so its begin/end-insert/remove transactions always straddle the actual mutation regardless of when the host emits deviceAdded/deviceRemoved.

Member Enumeration Documentation

◆ Roles

Enumerator
DeviceRole 
InterfaceNameRole 
DeviceTypeRole 
StateRole 
ManagedRole 

Constructor & Destructor Documentation

◆ NetworkDeviceModel()

PhosphorServiceNetwork::NetworkDeviceModel::NetworkDeviceModel ( QObject * parent = nullptr)
explicit

◆ ~NetworkDeviceModel()

PhosphorServiceNetwork::NetworkDeviceModel::~NetworkDeviceModel ( )
override

Member Function Documentation

◆ countChanged

void PhosphorServiceNetwork::NetworkDeviceModel::countChanged ( )
signal

◆ data()

QVariant PhosphorServiceNetwork::NetworkDeviceModel::data ( const QModelIndex & index,
int role ) const
nodiscardoverride

◆ host()

NetworkHost * PhosphorServiceNetwork::NetworkDeviceModel::host ( ) const
nodiscard

◆ hostChanged

void PhosphorServiceNetwork::NetworkDeviceModel::hostChanged ( )
signal

◆ roleNames()

QHash< int, QByteArray > PhosphorServiceNetwork::NetworkDeviceModel::roleNames ( ) const
nodiscardoverride

◆ rowCount()

int PhosphorServiceNetwork::NetworkDeviceModel::rowCount ( const QModelIndex & parent = {}) const
nodiscardoverride

◆ setHost()

void PhosphorServiceNetwork::NetworkDeviceModel::setHost ( NetworkHost * host)

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