ENLIGHTEN
Cross-platform desktop GUI for Wasatch Photonics spectrometers
Loading...
Searching...
No Matches
NodeListModel Class Reference

#include <nodelistmodel.h>

Inheritance diagram for NodeListModel:
[legend]
Collaboration diagram for NodeListModel:
[legend]

Public Types

enum  Roles {
  NameRole = Qt::UserRole + 1 , DisplayNameRole , CategoryRole , TypeRole ,
  TooltipRole , DescriptionRole , VisibilityRole , EntryListModelRole ,
  ValueRole , MinRole , MaxRole , IncRole ,
  UnitRole , AvailableRole , ReadableRole , WriteableRole ,
  AccessStatusRole , NodeObjectRole
}
 

Public Slots

void updateList (int a, int b, QVector< int > changedRoles=QVector< int >())
 

Public Member Functions

QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 
Q_INVOKABLE NodeListObjectget (const QString &name)
 
Q_INVOKABLE NodeListObjectget (int index)
 
 NodeListModel ()
 
void pauseUpdating ()
 
void resumeUpdating ()
 
int rowCount (const QModelIndex &index=QModelIndex()) const override
 
void setNodeMap (const std::shared_ptr< peak::core::NodeMap > &nodeMap)
 
void stopUpdating ()
 
QThread * updateThread ()
 
 ~NodeListModel () override=default
 

Protected Member Functions

QHash< int, QByteArray > roleNames () const override
 

Private Member Functions

void clear ()
 

Private Attributes

std::shared_ptr< peak::core::NodeMap > m_nodeMap
 
QStringList m_nodeNames
 
int m_objectCount {}
 
std::vector< std::shared_ptr< NodeListObject > > m_objects
 
QThread * m_updateThread = nullptr
 
ModelUpdateThreadWorkerm_updateThreadWorker = nullptr
 
QMutex mutex
 

Member Enumeration Documentation

◆ Roles

Enumerator
NameRole 
DisplayNameRole 
CategoryRole 
TypeRole 
TooltipRole 
DescriptionRole 
VisibilityRole 
EntryListModelRole 
ValueRole 
MinRole 
MaxRole 
IncRole 
UnitRole 
AvailableRole 
ReadableRole 
WriteableRole 
AccessStatusRole 
NodeObjectRole 

Constructor & Destructor Documentation

◆ NodeListModel()

NodeListModel::NodeListModel ( )

◆ ~NodeListModel()

NodeListModel::~NodeListModel ( )
overridedefault

Member Function Documentation

◆ clear()

void NodeListModel::clear ( )
private

◆ data()

QVariant NodeListModel::data ( const QModelIndex & index,
int role = Qt::DisplayRole ) const
override

◆ get() [1/2]

Q_INVOKABLE NodeListObject * NodeListModel::get ( const QString & name)

◆ get() [2/2]

Q_INVOKABLE NodeListObject * NodeListModel::get ( int index)

◆ pauseUpdating()

void NodeListModel::pauseUpdating ( )

◆ resumeUpdating()

void NodeListModel::resumeUpdating ( )

◆ roleNames()

QHash< int, QByteArray > NodeListModel::roleNames ( ) const
overrideprotected

◆ rowCount()

int NodeListModel::rowCount ( const QModelIndex & index = QModelIndex()) const
override

◆ setNodeMap()

void NodeListModel::setNodeMap ( const std::shared_ptr< peak::core::NodeMap > & nodeMap)

◆ stopUpdating()

void NodeListModel::stopUpdating ( )

◆ updateList

void NodeListModel::updateList ( int a,
int b,
QVector< int > changedRoles = QVector<int>() )
slot

◆ updateThread()

QThread * NodeListModel::updateThread ( )

Member Data Documentation

◆ m_nodeMap

std::shared_ptr<peak::core::NodeMap> NodeListModel::m_nodeMap
private

◆ m_nodeNames

QStringList NodeListModel::m_nodeNames
private

◆ m_objectCount

int NodeListModel::m_objectCount {}
private

◆ m_objects

std::vector<std::shared_ptr<NodeListObject> > NodeListModel::m_objects
private

◆ m_updateThread

QThread* NodeListModel::m_updateThread = nullptr
private

◆ m_updateThreadWorker

ModelUpdateThreadWorker* NodeListModel::m_updateThreadWorker = nullptr
private

◆ mutex

QMutex NodeListModel::mutex
mutableprivate

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