HAL
hal::PortTreeItem Class Reference

#include <port_tree_model.h>

Inheritance diagram for hal::PortTreeItem:
Inheritance graph
Collaboration diagram for hal::PortTreeItem:
Collaboration graph

Public Types

enum  Type { None , Pin , Group }
 

Public Member Functions

 PortTreeItem (Type itype, u32 id_, QString pinName, PinDirection dir, PinType ptype, QString netName=QString())
 
 PortTreeItem ()
 
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
 
void setItemType (Type tp)
 
Type itemType () const
 
QString name () const
 
void setName (const QString &nam)
 
void setPinType (PinType ptype)
 
void setPinDirection (PinDirection dir)
 
u32 id () const
 
- 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

Definition at line 41 of file port_tree_model.h.

Member Enumeration Documentation

◆ Type

Enumerator
None 
Pin 
Group 

Definition at line 44 of file port_tree_model.h.

Constructor & Destructor Documentation

◆ PortTreeItem() [1/2]

hal::PortTreeItem::PortTreeItem ( Type  itype,
u32  id_,
QString  pinName,
PinDirection  dir,
PinType  ptype,
QString  netName = QString() 
)

Definition at line 22 of file port_tree_model.cpp.

◆ PortTreeItem() [2/2]

hal::PortTreeItem::PortTreeItem ( )
inline

Definition at line 57 of file port_tree_model.h.

Member Function Documentation

◆ appendData()

void hal::PortTreeItem::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 69 of file port_tree_model.cpp.

References hal::data.

◆ getColumnCount()

int hal::PortTreeItem::getColumnCount ( ) const
overridevirtual

Get the number of currently stored column data.

Returns
The column count.

Implements hal::BaseTreeItem.

Definition at line 74 of file port_tree_model.cpp.

◆ getData()

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

Get the data of a specific column (most in the form of a string).

Parameters
column- The requested column.
Returns
The data if within the column count. Empty QVariant otherwise.

Implements hal::BaseTreeItem.

Definition at line 26 of file port_tree_model.cpp.

References hal::enum_to_string(), and QString::fromStdString().

Referenced by hal::ModulePinsTree::handleContextMenuRequested().

◆ id()

u32 hal::PortTreeItem::id ( ) const
inline

Returns the pin-id if the item represents a pin or the pingroup-id if the item represents a pingroup.

Parameters
item- The item.
Returns
The pin- or pingroup-id.

Definition at line 77 of file port_tree_model.h.

Referenced by hal::ModulePinsTreeModel::getNetFromItem(), hal::ModulePinsTree::handleContextMenuRequested(), hal::ModulePinsTreeModel::handleModulePortsChanged(), and hal::ModulePinsTreeModel::mimeData().

◆ itemType()

Type hal::PortTreeItem::itemType ( ) const
inline

◆ name()

QString hal::PortTreeItem::name ( ) const
inline

Definition at line 65 of file port_tree_model.h.

◆ setData()

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

Sets the data for all columns.

Parameters
data- Each entry in the list represents one column.

Implements hal::BaseTreeItem.

Definition at line 42 of file port_tree_model.cpp.

References hal::data.

◆ setDataAtIndex()

void hal::PortTreeItem::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 50 of file port_tree_model.cpp.

References hal::data.

◆ setItemType()

void hal::PortTreeItem::setItemType ( Type  tp)
inline

Definition at line 63 of file port_tree_model.h.

◆ setName()

void hal::PortTreeItem::setName ( const QString nam)
inline

◆ setPinDirection()

void hal::PortTreeItem::setPinDirection ( PinDirection  dir)
inline

◆ setPinType()

void hal::PortTreeItem::setPinType ( PinType  ptype)
inline

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