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

The model that contains the LibraryItems to display library hierarchically. More...

#include <LibraryModel.h>

Inheritance diagram for LibraryModel:

Public Slots

void onAddVLNV (VLNV const &vlnv)
 Add the specified vlnv branch to the tree.
 
void onCreateAbsDef (QModelIndex const &index)
 Create a new abstraction definition for given bus 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 in search view.
 
void onDocumentUpdated (VLNV const &vlnv)
 
void onExportItem (QModelIndex const &index)
 When export is selected in search view.
 
void onOpenDesign (QModelIndex const &index, QString const &viewName)
 Open the selected hierarchical design.
 
void onOpenDocument (QModelIndex const &index)
 Open the selected document e.g. component or bus definition.
 
void onOpenMemoryDesign (QModelIndex const &index, QString const &viewName)
 Open the selected memory design.
 
void onOpenSWDesign (QModelIndex const &index)
 Open the selected hierarchical SW design.
 
void onOpenSystemDesign (QModelIndex const &index, QString const &viewName)
 Open the selected hierarchical system design.
 
void onRemoveVLNV (VLNV const &vlnv)
 Remove the specified vlnv branch 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 &vlnv)
 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 &message)
 Emit an error message to be printed to user.
 
void exportItems (const QList< VLNV > list)
 Export a list of vlnv items to a new location.
 
void invalidateFilter ()
 Refresh the item filtering because changes have been made.
 
void noticeMessage (const QString &message)
 Emit a notice message to be printed to user.
 
void openDesign (VLNV const &vlnv, QString const &viewName)
 Open the design of a component.
 
void openMemoryDesign (VLNV const &vlnv, QString const &viewName)
 Open the memory design of a HW design.
 
void openSWDesign (VLNV const &vlnv)
 Open the SW design of a component.
 
void openSystemDesign (VLNV const &vlnv, QString const &viewName)
 Open the system design of a component.
 
void removeVLNV (QList< VLNV > vlnvs)
 Remove the specified VLNV from the library.
 
void showErrors (VLNV const &vlnv)
 Shows errors about the item at the given index.
 

Public Member Functions

 LibraryModel (LibraryInterface *handler, QObject *parent=0)
 
virtual ~LibraryModel ()
 The destructor.
 
virtual int columnCount (QModelIndex const &parent=QModelIndex()) const
 
virtual QVariant data (QModelIndex const &index, int role=Qt::DisplayRole) const
 
Qt::ItemFlags flags (QModelIndex const &index) const
 
LibraryItemgetRoot () const
 
virtual bool hasChildren (QModelIndex const &parent=QModelIndex()) const
 
virtual QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
 
virtual QModelIndex index (int row, int column, QModelIndex const &parent=QModelIndex()) const
 
QModelIndex index (LibraryItem *item)
 
virtual QModelIndex parent (QModelIndex const &child) const
 
virtual int rowCount (QModelIndex const &parent=QModelIndex()) const
 

Protected Attributes

LibraryInterfacehandler_
 The instance that manages the library.
 

Detailed Description

The model that contains the LibraryItems to display library hierarchically.

Definition at line 32 of file LibraryModel.h.

Constructor & Destructor Documentation

◆ LibraryModel()

LibraryModel::LibraryModel ( LibraryInterface * handler,
QObject * parent = 0 )

The constructor

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

◆ ~LibraryModel()

virtual LibraryModel::~LibraryModel ( )
virtual

The destructor.

Member Function Documentation

◆ columnCount()

virtual int LibraryModel::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 LibraryModel::createAbsDef ( VLNV const & vlnv)
signal

Create a new abstraction definition for given bus definition.

◆ createDesign

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

Create new design with given vlnv.

◆ createSWDesign

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

Create new SW design with given vlnv.

◆ createSystemDesign

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

Create new system design with given vlnv.

◆ data()

virtual QVariant LibraryModel::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 LibraryModel::editItem ( VLNV const & vlnv)
signal

Open the component in a component editor.

◆ errorMessage

void LibraryModel::errorMessage ( const QString & message)
signal

Emit an error message to be printed to user.

◆ exportItems

void LibraryModel::exportItems ( const QList< VLNV > list)
signal

Export a list of vlnv items to a new location.

◆ flags()

Qt::ItemFlags LibraryModel::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.

◆ getRoot()

LibraryItem * LibraryModel::getRoot ( ) const

Get the root item of the tree.

Returns
The root item

◆ hasChildren()

virtual bool LibraryModel::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 LibraryModel::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]

virtual QModelIndex LibraryModel::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.

◆ index() [2/2]

QModelIndex LibraryModel::index ( LibraryItem * item)

Create a model index for a library item

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

◆ invalidateFilter

void LibraryModel::invalidateFilter ( )
signal

Refresh the item filtering because changes have been made.

◆ noticeMessage

void LibraryModel::noticeMessage ( const QString & message)
signal

Emit a notice message to be printed to user.

◆ onAddVLNV

void LibraryModel::onAddVLNV ( VLNV const & vlnv)
slot

Add the specified vlnv branch to the tree.

◆ onCreateAbsDef

void LibraryModel::onCreateAbsDef ( QModelIndex const & index)
slot

Create a new abstraction definition for given bus definition.

◆ onCreateNewDesign

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

Create new design.

◆ onCreateNewSWDesign

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

Create new SW design.

◆ onCreateNewSystemDesign

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

Create new system design.

◆ onDeleteItem

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

When delete is selected in search view.

◆ onDocumentUpdated

void LibraryModel::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 LibraryModel::onExportItem ( QModelIndex const & index)
slot

When export is selected in search view.

◆ onOpenDesign

void LibraryModel::onOpenDesign ( QModelIndex const & index,
QString const & viewName )
slot

Open the selected hierarchical design.

◆ onOpenDocument

void LibraryModel::onOpenDocument ( QModelIndex const & index)
slot

Open the selected document e.g. component or bus definition.

◆ onOpenMemoryDesign

void LibraryModel::onOpenMemoryDesign ( QModelIndex const & index,
QString const & viewName )
slot

Open the selected memory design.

◆ onOpenSWDesign

void LibraryModel::onOpenSWDesign ( QModelIndex const & index)
slot

Open the selected hierarchical SW design.

◆ onOpenSystemDesign

void LibraryModel::onOpenSystemDesign ( QModelIndex const & index,
QString const & viewName )
slot

Open the selected hierarchical system design.

◆ onRemoveVLNV

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

Remove the specified vlnv branch from the tree.

◆ onResetModel

void LibraryModel::onResetModel ( )
slot

Reset the model.

◆ onShowErrors

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

Shows errors about the item at the given index.

◆ openDesign

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

Open the design of a component.

◆ openMemoryDesign

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

Open the memory design of a HW design.

◆ openSWDesign

void LibraryModel::openSWDesign ( VLNV const & vlnv)
signal

Open the SW design of a component.

◆ openSystemDesign

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

Open the system design of a component.

◆ parent()

virtual QModelIndex LibraryModel::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.

◆ removeVLNV

void LibraryModel::removeVLNV ( QList< VLNV > vlnvs)
signal

Remove the specified VLNV from the library.

◆ rowCount()

virtual int LibraryModel::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 LibraryModel::showErrors ( VLNV const & vlnv)
signal

Shows errors about the item at the given index.

Member Data Documentation

◆ handler_

LibraryInterface* LibraryModel::handler_
protected

The instance that manages the library.

Definition at line 237 of file LibraryModel.h.


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