Kactus2
Kactus2 reference guide
Loading...
Searching...
No Matches
HierarchyModel Class Reference

Contains the items to display the library component hierarchy to user. More...

#include <hierarchymodel.h>

Inheritance diagram for HierarchyModel:

Public Types

enum  Column { OBJECT_COLUMN = 0 , INSTANCE_COLUMN , COLUMN_COUNT }
 Defines the columns for the model. More...
 

Public Slots

void onCreateNewAbsDef (QModelIndex const &index)
 Create new abstraction definition.
 
void onCreateNewDesign (QModelIndex const &index)
 Create new design.
 
void onCreateNewSWDesign (QModelIndex const &index)
 Create new SW design.
 
void onCreateNewSystemDesign (QModelIndex const &index)
 Create new system design.
 
void onDeleteItem (QModelIndex const &index)
 When delete is selected.
 
void onDocumentUpdated (VLNV const &vlnv)
 
void onExportItem (QModelIndex const &index)
 When export is selected in search view.
 
void onOpenDesign (QModelIndex const &index)
 Open the selected hierarchical design.
 
void onOpenItem (QModelIndex const &index)
 Open the selected component.
 
void onOpenMemoryDesign (QModelIndex const &index)
 Open the memory design of the selected design.
 
void onRemoveVLNV (VLNV const &vlnv)
 Remove the specified vlnv from the tree.
 
void onResetModel ()
 Reset the model.
 
void onShowErrors (QModelIndex const &index)
 Shows errors about the item at the given index.
 

Signals

void createAbsDef (VLNV const &busDefVLNV)
 Create a new abstraction definition for given bus definition.
 
void createDesign (VLNV const &vlnv)
 Create new design with given vlnv.
 
void createSWDesign (VLNV const &vlnv)
 Create new SW design with given vlnv.
 
void createSystemDesign (VLNV const &vlnv)
 Create new system design with given vlnv.
 
void editItem (VLNV const &vlnv)
 Open the component in a component editor.
 
void errorMessage (const QString &msg)
 Send an error message to be printed to user.
 
void exportItem (VLNV const &vlnv)
 Export an item to a new location.
 
void invalidateFilter ()
 Refresh the item filtering because changes have been made.
 
void noticeMessage (const QString &msg)
 Send a notification to be printed to user.
 
void openDesign (VLNV const &vlnv, const QString &viewName)
 Open the design of a component.
 
void openMemoryDesign (VLNV const &vlnv, const QString &viewName)
 Open the memory design of a component.
 
void openSWDesign (VLNV const &vlnv, const QString &viewName)
 Open the SW design of a component.
 
void openSystemDesign (VLNV const &vlnv, const QString &viewName)
 Open the system design of a component.
 
void removeVLNV (QList< VLNV > vlnv)
 Remove the specified VLNV from the library.
 
void showErrors (VLNV const &vlnv)
 Shows errors about the item at the given index.
 

Public Member Functions

 HierarchyModel (LibraryInterface *handler, QObject *parent)
 
virtual ~HierarchyModel ()=default
 The destructor.
 
virtual int columnCount (QModelIndex const &parent=QModelIndex()) const
 
virtual QVariant data (QModelIndex const &index, int role=Qt::DisplayRole) const
 
QModelIndexList findIndexes (VLNV const &vlnv)
 
Qt::ItemFlags flags (QModelIndex const &index) const
 
void getChildren (QList< VLNV > &childList, VLNV const &owner) const
 
virtual int getOwners (QList< VLNV > &list, VLNV const &vlnvToSearch) const
 
virtual bool hasChildren (QModelIndex const &parent=QModelIndex()) const
 
virtual QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
 
QModelIndex index (HierarchyItem *item) const
 
virtual QModelIndex index (int row, int column, QModelIndex const &parent=QModelIndex()) const
 
virtual QModelIndex parent (QModelIndex const &child) const
 
int referenceCount (VLNV const &vlnv) const
 
virtual int rowCount (QModelIndex const &parent=QModelIndex()) const
 

Detailed Description

Contains the items to display the library component hierarchy to user.

Definition at line 28 of file hierarchymodel.h.

Member Enumeration Documentation

◆ Column

Defines the columns for the model.

Enumerator
OBJECT_COLUMN 
INSTANCE_COLUMN 
COLUMN_COUNT 

Definition at line 35 of file hierarchymodel.h.

Constructor & Destructor Documentation

◆ HierarchyModel()

HierarchyModel::HierarchyModel ( LibraryInterface * handler,
QObject * parent )

The constructor

Parameters
[in]handlerThe instance that manages the library.
[in]parentThe owner of this model.

◆ ~HierarchyModel()

virtual HierarchyModel::~HierarchyModel ( )
virtualdefault

The destructor.

Member Function Documentation

◆ columnCount()

virtual int HierarchyModel::columnCount ( QModelIndex const & parent = QModelIndex()) const
virtual

Get the number of columns in this model

Parameters
[in]parentModel index identifying the item that's column count is wanted.
Returns
Number of columns.

◆ createAbsDef

void HierarchyModel::createAbsDef ( VLNV const & busDefVLNV)
signal

Create a new abstraction definition for given bus definition.

◆ createDesign

void HierarchyModel::createDesign ( VLNV const & vlnv)
signal

Create new design with given vlnv.

◆ createSWDesign

void HierarchyModel::createSWDesign ( VLNV const & vlnv)
signal

Create new SW design with given vlnv.

◆ createSystemDesign

void HierarchyModel::createSystemDesign ( VLNV const & vlnv)
signal

Create new system design with given vlnv.

◆ data()

virtual QVariant HierarchyModel::data ( QModelIndex const & index,
int role = Qt::DisplayRole ) const
virtual

Get the data associated with given object.

Parameters
[in]indexModel index that identifies the object that's data is wanted.
[in]roleSpecifies the type of data wanted.
Returns
QVariant Containing the requested data.

◆ editItem

void HierarchyModel::editItem ( VLNV const & vlnv)
signal

Open the component in a component editor.

◆ errorMessage

void HierarchyModel::errorMessage ( const QString & msg)
signal

Send an error message to be printed to user.

◆ exportItem

void HierarchyModel::exportItem ( VLNV const & vlnv)
signal

Export an item to a new location.

◆ findIndexes()

QModelIndexList HierarchyModel::findIndexes ( VLNV const & vlnv)

Find model indexes of items that represent given vlnv.

Parameters
[in]vlnvIdentifies the objects to search for.
Returns
QModelIndexList contains indexes of items with given vlnv.

◆ flags()

Qt::ItemFlags HierarchyModel::flags ( QModelIndex const & index) const

Get the flags that identify possible methods for given object.

Parameters
[in]indexModel index identifying the object that's flags are requested.
Returns
Qt::ItemFlags that specify how the object can be handled.

◆ getChildren()

void HierarchyModel::getChildren ( QList< VLNV > & childList,
VLNV const & owner ) const

Get the child items of given object.

Parameters
[out]childListThe list where the vlnvs of the children are appended.
[in]ownerIdentifies the object that's children are searched.

◆ getOwners()

virtual int HierarchyModel::getOwners ( QList< VLNV > & list,
VLNV const & vlnvToSearch ) const
virtual

Get the components that have instantiated the given vlnv in their design.

This function makes sure each owner is appended to the list only once.

Parameters
[out]listQList where the search results are appended.
[in]vlnvToSearchIdentifies the component to search for.
Returns
Number of owners found.

◆ hasChildren()

virtual bool HierarchyModel::hasChildren ( QModelIndex const & parent = QModelIndex()) const
virtual

Does the specified item have child items or not.

Parameters
[in]parentModel index identifying the object that's children are asked.
Returns
True if object has child objects.

◆ headerData()

virtual QVariant HierarchyModel::headerData ( int section,
Qt::Orientation orientation,
int role = Qt::DisplayRole ) const
virtual

Get the data for the headers of this model.

Parameters
[in]sectionSpecifies the column of the header.
[in]orientationThe orientation of the header, only Qt::Horizontal supported.
[in]roleSpecifies the role of the data.
Returns
QVariant containing the data.

◆ index() [1/2]

QModelIndex HierarchyModel::index ( HierarchyItem * item) const

Create a model index for a library item

Parameters
[in]itemThe LibraryItem that's model index is wanted
Returns
QModelIndex that identifies the libraryItem.

◆ index() [2/2]

virtual QModelIndex HierarchyModel::index ( int row,
int column,
QModelIndex const & parent = QModelIndex() ) const
virtual

Get the model index of the specified object.

Parameters
[in]rowRow number of the object.
[in]columnColumn number of the object.
[in]parentModel index of the parent of the object.
Returns
QModelIndex that identifies the object.

◆ invalidateFilter

void HierarchyModel::invalidateFilter ( )
signal

Refresh the item filtering because changes have been made.

◆ noticeMessage

void HierarchyModel::noticeMessage ( const QString & msg)
signal

Send a notification to be printed to user.

◆ onCreateNewAbsDef

void HierarchyModel::onCreateNewAbsDef ( QModelIndex const & index)
slot

Create new abstraction definition.

◆ onCreateNewDesign

void HierarchyModel::onCreateNewDesign ( QModelIndex const & index)
slot

Create new design.

◆ onCreateNewSWDesign

void HierarchyModel::onCreateNewSWDesign ( QModelIndex const & index)
slot

Create new SW design.

◆ onCreateNewSystemDesign

void HierarchyModel::onCreateNewSystemDesign ( QModelIndex const & index)
slot

Create new system design.

◆ onDeleteItem

void HierarchyModel::onDeleteItem ( QModelIndex const & index)
slot

When delete is selected.

◆ onDocumentUpdated

void HierarchyModel::onDocumentUpdated ( VLNV const & vlnv)
slot

This function should be called when an IP-XACT document has changed.

Function updates the hierarchical model so that changes made to the document are visible.

Parameters
[in]vlnvIdentifies the document that changed.

◆ onExportItem

void HierarchyModel::onExportItem ( QModelIndex const & index)
slot

When export is selected in search view.

◆ onOpenDesign

void HierarchyModel::onOpenDesign ( QModelIndex const & index)
slot

Open the selected hierarchical design.

◆ onOpenItem

void HierarchyModel::onOpenItem ( QModelIndex const & index)
slot

Open the selected component.

◆ onOpenMemoryDesign

void HierarchyModel::onOpenMemoryDesign ( QModelIndex const & index)
slot

Open the memory design of the selected design.

◆ onRemoveVLNV

void HierarchyModel::onRemoveVLNV ( VLNV const & vlnv)
slot

Remove the specified vlnv from the tree.

◆ onResetModel

void HierarchyModel::onResetModel ( )
slot

Reset the model.

◆ onShowErrors

void HierarchyModel::onShowErrors ( QModelIndex const & index)
slot

Shows errors about the item at the given index.

◆ openDesign

void HierarchyModel::openDesign ( VLNV const & vlnv,
const QString & viewName )
signal

Open the design of a component.

◆ openMemoryDesign

void HierarchyModel::openMemoryDesign ( VLNV const & vlnv,
const QString & viewName )
signal

Open the memory design of a component.

◆ openSWDesign

void HierarchyModel::openSWDesign ( VLNV const & vlnv,
const QString & viewName )
signal

Open the SW design of a component.

◆ openSystemDesign

void HierarchyModel::openSystemDesign ( VLNV const & vlnv,
const QString & viewName )
signal

Open the system design of a component.

◆ parent()

virtual QModelIndex HierarchyModel::parent ( QModelIndex const & child) const
virtual

Get the model index of the parent of the object

Parameters
[in]childModel index that identifies the child of the object.
Returns
QModelIndex that identifies the parent of the given object.

◆ referenceCount()

int HierarchyModel::referenceCount ( VLNV const & vlnv) const

Count how many times the given component is instantiated in the library.

This function does not check if the same owner is counted multiple times if same sub-component is instantiated in several components. If count that contains only unique owners then you should use getOwners().

Parameters
[in]vlnvIdentifies the component that's instances are searched.
Returns
Number of found instances.

◆ removeVLNV

void HierarchyModel::removeVLNV ( QList< VLNV > vlnv)
signal

Remove the specified VLNV from the library.

◆ rowCount()

virtual int HierarchyModel::rowCount ( QModelIndex const & parent = QModelIndex()) const
virtual

Get the number of rows an item has.

Parameters
[in]parentModel index identifying the item that's row count is wanted
Returns
Number of rows the item has.

◆ showErrors

void HierarchyModel::showErrors ( VLNV const & vlnv)
signal

Shows errors about the item at the given index.


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