HAL
hal::PinItem Class Reference

An item in the PinModel. More...

#include <pin_item.h>

Inheritance diagram for hal::PinItem:
Inheritance graph
Collaboration diagram for hal::PinItem:
Collaboration graph

Public Types

enum class  TreeItemType {
  PinGroup , Pin , GroupCreator , PinCreator ,
  InvalidPinGroup , InvalidPin
}
 

Public Member Functions

void setData (QList< QVariant > data) override
 
void setDataAtIndex (int index, QVariant &data) override
 
void appendData (QVariant data) override
 
int getColumnCount () const override
 
 PinItem (TreeItemType type)
 
QVariant getData (int column) const override
 
int row () const
 
u32 getId () const
 
QString getName () const
 
PinType getPinType () const
 
PinDirection getDirection () const
 
QString getPinTypeAsText () const
 
QString getDirectionAsText () const
 
TreeItemType getItemType () const
 
void setName (const QString &name)
 
void setDirection (const QString &direction)
 
void setId (u32 newId)
 
void setType (const QString &type)
 
void setDirection (PinDirection direction)
 
void setType (PinType type)
 
void setFields (GatePin *pin)
 
void setFields (const QString &name, u32 id, PinDirection direction, PinType type)
 
void setItemType (TreeItemType type)
 
- 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

An item in the PinModel.

The PinItem is one item in the PinModel item model.

Definition at line 47 of file pin_item.h.

Member Enumeration Documentation

◆ TreeItemType

Enumerator
PinGroup 
Pin 
GroupCreator 
PinCreator 
InvalidPinGroup 
InvalidPin 

Definition at line 50 of file pin_item.h.

Constructor & Destructor Documentation

◆ PinItem()

hal::PinItem::PinItem ( PinItem::TreeItemType  type)

Constructor.

Definition at line 10 of file pin_item.cpp.

Member Function Documentation

◆ appendData()

void hal::PinItem::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 130 of file pin_item.cpp.

◆ getColumnCount()

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

Get the number of currently stored column data.

Returns
The column count.

Implements hal::BaseTreeItem.

Definition at line 125 of file pin_item.cpp.

◆ getData()

QVariant hal::PinItem::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 24 of file pin_item.cpp.

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

◆ getDirection()

◆ getDirectionAsText()

QString hal::PinItem::getDirectionAsText ( ) const

Definition at line 101 of file pin_item.cpp.

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

Referenced by hal::PinModel::handleEditDirection().

◆ getId()

u32 hal::PinItem::getId ( ) const

Definition at line 106 of file pin_item.cpp.

◆ getItemType()

◆ getName()

◆ getPinType()

◆ getPinTypeAsText()

QString hal::PinItem::getPinTypeAsText ( ) const

Definition at line 91 of file pin_item.cpp.

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

◆ row()

int hal::PinItem::row ( ) const

◆ setData()

void hal::PinItem::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 48 of file pin_item.cpp.

References hal::data, GroupCreator, hal::none, Pin, PinCreator, and PinGroup.

◆ setDataAtIndex()

void hal::PinItem::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 76 of file pin_item.cpp.

◆ setDirection() [1/2]

void hal::PinItem::setDirection ( const QString direction)

◆ setDirection() [2/2]

void hal::PinItem::setDirection ( PinDirection  direction)

Definition at line 138 of file pin_item.cpp.

References direction.

◆ setFields() [1/2]

void hal::PinItem::setFields ( const QString name,
u32  id,
PinDirection  direction,
PinType  type 
)

Definition at line 152 of file pin_item.cpp.

References direction, id, name, setDirection(), setType(), and type.

◆ setFields() [2/2]

◆ setId()

void hal::PinItem::setId ( u32  newId)

Definition at line 72 of file pin_item.cpp.

Referenced by hal::PinModel::handleEditName(), and hal::PinModel::setGate().

◆ setItemType()

void hal::PinItem::setItemType ( PinItem::TreeItemType  type)

Definition at line 160 of file pin_item.cpp.

References type.

◆ setName()

void hal::PinItem::setName ( const QString name)

Sets the name of this PinItem

Parameters
name- The new name

Definition at line 111 of file pin_item.cpp.

References name.

Referenced by hal::PinModel::handleEditName(), and hal::PinModel::setGate().

◆ setType() [1/2]

void hal::PinItem::setType ( const QString type)

◆ setType() [2/2]

void hal::PinItem::setType ( PinType  type)

Definition at line 143 of file pin_item.cpp.

References type.


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