HAL
hal::RootTreeItem Class Reference

#include <base_tree_item.h>

Inheritance diagram for hal::RootTreeItem:
Inheritance graph
Collaboration diagram for hal::RootTreeItem:
Collaboration graph

Public Member Functions

 RootTreeItem (const QStringList &labels)
 
QVariant getData (int column) const override
 
void setData (QList< QVariant > data) override
 
void setDataAtIndex (int index, QVariant &data) override
 
void appendData (QVariant data) override
 
int getColumnCount () const override
 
- Public Member Functions inherited from hal::BaseTreeItem
 BaseTreeItem ()
 
 BaseTreeItem (QList< QVariant > columnData)
 
virtual ~BaseTreeItem ()
 
virtual BaseTreeItemgetParent () const
 
virtual void setParent (BaseTreeItem *parent)
 
virtual BaseTreeItemgetChild (int row) const
 
virtual QList< BaseTreeItem * > getChildren () const
 
virtual void appendChild (BaseTreeItem *child)
 
virtual void insertChild (int index, BaseTreeItem *child)
 
virtual BaseTreeItemremoveChildAtPos (int row)
 
virtual bool removeChild (BaseTreeItem *child)
 
virtual int getChildCount () const
 
virtual int getRowForChild (const BaseTreeItem *child) const
 
virtual int getOwnRow ()
 

Additional Inherited Members

- Protected Attributes inherited from hal::BaseTreeItem
BaseTreeItemmParent
 
QList< BaseTreeItem * > mChildren
 

Detailed Description

Since the BaseTreeItem class is pure virtual it cannot be instanciated for root tree item.

RootTreeItem class also provides the header labels.

Definition at line 203 of file base_tree_item.h.

Constructor & Destructor Documentation

◆ RootTreeItem()

hal::RootTreeItem::RootTreeItem ( const QStringList labels)
inline

Definition at line 207 of file base_tree_item.h.

Member Function Documentation

◆ appendData()

void hal::RootTreeItem::appendData ( QVariant  data)
overridevirtual

Appends a new column to the item.

Parameters
data- The data of the new column.

Implements hal::BaseTreeItem.

Definition at line 124 of file base_tree_item.cpp.

◆ getColumnCount()

int hal::RootTreeItem::getColumnCount ( ) const
inlineoverridevirtual

Get number of sections for which header label exist.

Returns
The number of sections.

Implements hal::BaseTreeItem.

Definition at line 243 of file base_tree_item.h.

References QList::size().

Referenced by hal::BaseTreeModel::columnCount().

◆ getData()

QVariant hal::RootTreeItem::getData ( int  column) const
overridevirtual

Get header label for section.

Parameters
columnThe section of the header.
Returns
The label for the header.

Implements hal::BaseTreeItem.

Definition at line 102 of file base_tree_item.cpp.

References QList::at(), and QList::size().

Referenced by hal::BaseTreeModel::headerData().

◆ setData()

void hal::RootTreeItem::setData ( QList< QVariant data)
overridevirtual

Set header label to new value. If element in list does not exist it gets created.

Parameters
columnThe section of the header.
dataThe string value.

Implements hal::BaseTreeItem.

Definition at line 109 of file base_tree_item.cpp.

References QList::clear(), and hal::data.

◆ setDataAtIndex()

void hal::RootTreeItem::setDataAtIndex ( int  index,
QVariant data 
)
overridevirtual

Sets the data for a specified column. The index must be within already existing boundaries (for example, add dummy data beforehand).

Parameters
index- The column to set the new data.
data- The new column data.

Implements hal::BaseTreeItem.

Definition at line 117 of file base_tree_item.cpp.

References hal::data, and QList::size().

Referenced by hal::BaseTreeModel::setHeaderLabels().


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