HAL
hal::GroupingTableEntry Class Reference

An entry within a GroupingTableModel. More...

#include <grouping_table_model.h>

Collaboration diagram for hal::GroupingTableEntry:
Collaboration graph

Public Member Functions

 GroupingTableEntry (const QString &n)
 
 GroupingTableEntry (u32 existingId)
 
 GroupingTableEntry (Grouping *grp)
 
u32 id () const
 
QString name () const
 
QColor color () const
 
void setName (const QString &n)
 
void setColor (const QColor &c)
 
Groupinggrouping () const
 

Detailed Description

An entry within a GroupingTableModel.

The GroupingTableEntry represents one entry in the groupings table. Therefore it stores information about the grouping. It also provides and interface to change these fields.

Definition at line 48 of file grouping_table_model.h.

Constructor & Destructor Documentation

◆ GroupingTableEntry() [1/3]

hal::GroupingTableEntry::GroupingTableEntry ( const QString n)

Constructor.
Creates a new grouping in the netlist.

Parameters
n- The name of the grouping

Definition at line 16 of file grouping_table_model.cpp.

References hal::Netlist::create_grouping(), hal::gNetlist, and test::n.

◆ GroupingTableEntry() [2/3]

hal::GroupingTableEntry::GroupingTableEntry ( u32  existingId)

Constructor.
Initializes the GroupingTableEntry with an already existing grouping of the netlist.

Parameters
existingId- The id of an already existing grouping of the netlist.

Definition at line 22 of file grouping_table_model.cpp.

References hal::Netlist::get_grouping_by_id(), and hal::gNetlist.

◆ GroupingTableEntry() [3/3]

hal::GroupingTableEntry::GroupingTableEntry ( Grouping grp)
inline

Constructor.
Initializes the GroupingTableEntry with an already existing grouping.

Parameters
grp- The grouping to represent
c- The color of the grouping

Definition at line 75 of file grouping_table_model.h.

Member Function Documentation

◆ color()

QColor hal::GroupingTableEntry::color ( ) const

Gets the color of the grouping.

Returns
the color of the grouping

Definition at line 40 of file grouping_table_model.cpp.

References hal::Grouping::get_color(), and hal::toQColor().

Referenced by hal::GroupingTableModel::data(), hal::GroupingsOfItemModel::data(), hal::ActionDeleteObject::exec(), and hal::GroupingColorSerializer::serialize().

◆ grouping()

Grouping* hal::GroupingTableEntry::grouping ( ) const
inline

Accesses the grouping this entry represents.

Returns
the grouping

Definition at line 118 of file grouping_table_model.h.

Referenced by hal::GroupingTableModel::addDefaultEntry(), and hal::ActionDeleteObject::exec().

◆ id()

u32 hal::GroupingTableEntry::id ( ) const

Gets the id of the grouping.

Returns
the id of the grouping

Definition at line 28 of file grouping_table_model.cpp.

References hal::Grouping::get_id().

Referenced by hal::GroupingTableModel::data(), hal::GroupingsOfItemModel::data(), hal::ActionDeleteObject::exec(), and hal::GroupingColorSerializer::serialize().

◆ name()

QString hal::GroupingTableEntry::name ( ) const

Gets the name of the grouping.

Returns
the id of the grouping

Definition at line 34 of file grouping_table_model.cpp.

References QString::fromStdString(), and hal::Grouping::get_name().

Referenced by hal::GroupingTableModel::data(), hal::GroupingsOfItemModel::data(), and hal::ActionDeleteObject::exec().

◆ setColor()

void hal::GroupingTableEntry::setColor ( const QColor c)

Sets the color for the grouping.

Parameters
c- the new color for the grouping

Definition at line 52 of file grouping_table_model.cpp.

References QColor::hue(), QColor::saturation(), hal::Grouping::set_color(), and QColor::value().

◆ setName()

void hal::GroupingTableEntry::setName ( const QString n)

Sets the name of the grouping.

Parameters
n- The new name of the grouping

Definition at line 46 of file grouping_table_model.cpp.

References test::n, and hal::Grouping::set_name().


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