DBC Framework
DBC parsing and CAN signal decoding framework
Loading...
Searching...
No Matches
DbcTreeModel Class Reference

#include <dbc_tree_model.h>

+ Inheritance diagram for DbcTreeModel:

Public Types

enum  Column {
  Name , CanId , PayloadLength , StartBit ,
  BitLength , ByteOrder , Signed , Unit ,
  Comment , ColumnCount
}
 
enum  Role {
  NodeTypeRole = Qt::UserRole + 1 , CanIdRole , PayloadLengthRole , StartBitRole ,
  BitLengthRole , LittleEndianRole , SignedRole , UnitRole ,
  CommentRole , ValueDescriptionsRole , ExtendedRole
}
 

Public Member Functions

 DbcTreeModel (QObject *parent=nullptr)
 
void SetTree (std::unique_ptr< TreeNode > root)
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
 
QModelIndex parent (const QModelIndex &child) const override
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 

Detailed Description

Read-only model. Owns an immutable tree; all indexes expire on SetTree(). Use QPersistentModelIndex to observe reset invalidation. Call on the model thread.

Definition at line 11 of file dbc_tree_model.h.

Member Enumeration Documentation

◆ Column

enum DbcTreeModel::Column

Definition at line 13 of file dbc_tree_model.h.

◆ Role

enum DbcTreeModel::Role

Definition at line 24 of file dbc_tree_model.h.

Constructor & Destructor Documentation

◆ DbcTreeModel()

DbcTreeModel::DbcTreeModel ( QObject *  parent = nullptr)
explicit

Definition at line 25 of file dbc_tree_model.cpp.

Member Function Documentation

◆ SetTree()

void DbcTreeModel::SetTree ( std::unique_ptr< TreeNode >  root)

Definition at line 27 of file dbc_tree_model.cpp.

◆ index()

QModelIndex DbcTreeModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const
override

Definition at line 42 of file dbc_tree_model.cpp.

◆ parent()

QModelIndex DbcTreeModel::parent ( const QModelIndex &  child) const
override

Definition at line 53 of file dbc_tree_model.cpp.

◆ rowCount()

int DbcTreeModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

Definition at line 61 of file dbc_tree_model.cpp.

◆ columnCount()

int DbcTreeModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
override

Definition at line 70 of file dbc_tree_model.cpp.

◆ data()

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

Definition at line 74 of file dbc_tree_model.cpp.

◆ headerData()

QVariant DbcTreeModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const
override

Definition at line 138 of file dbc_tree_model.cpp.

◆ flags()

Qt::ItemFlags DbcTreeModel::flags ( const QModelIndex &  index) const
override

Definition at line 145 of file dbc_tree_model.cpp.


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