fw4spl
uiMedDataQt::widget::SelectorModel Class Reference

This class represents the Selector Model. More...

#include <SelectorModel.hpp>

+ Inheritance diagram for uiMedDataQt::widget::SelectorModel:
+ Collaboration diagram for uiMedDataQt::widget::SelectorModel:

Public Types

enum  Role { ITEM_TYPE = Qt::UserRole, UID }
 Defines the role of the items data (ITEM_TYPE or UID) More...
 
enum  ItemType { STUDY = 1, SERIES }
 Defines item type (STUDY or SERIES), it is used in items data (ITEM_TYPE role). More...
 
typedef std::map< std::string, std::string > SeriesIconType
 Map associating icons to series (map<series classname, icon path>)
 

Public Member Functions

UIMEDDATAQT_API SelectorModel (QWidget *parent=0)
 Constructor. Inits the model.
 
UIMEDDATAQT_API ~SelectorModel ()
 Destructor. Does nothing.
 
UIMEDDATAQT_API void addSeries (::fwMedData::Series::sptr series)
 Add the Series in the tree. If the associated study already exist in the tree, the series is added to this study.
 
UIMEDDATAQT_API void removeSeries (::fwMedData::Series::sptr series)
 Removes the Series from the tree. After deletion, if the study is empty, it will be removed. More...
 
UIMEDDATAQT_API void clear ()
 Clears all items in the model.
 
Qt::ItemFlags flags (const QModelIndex &index) const
 Returns item flags with non editable flag.
 
UIMEDDATAQT_API ItemType getItemType (const QModelIndex &index)
 Returns the type of the item (SERIES or STUDY) associated to the ITEM_TYPE role.
 
UIMEDDATAQT_API QModelIndex getIndex (const QModelIndex &index, int column)
 Returns the index in the same row as the given index and at the specified column. More...
 
UIMEDDATAQT_API void removeRows (const QModelIndexList indexes)
 Removes the rows given by the indexes.
 
UIMEDDATAQT_API QStandardItem * findSeriesItem (::fwMedData::Series::sptr series)
 Returns the series item representing the series.
 
UIMEDDATAQT_API QStandardItem * findStudyItem (::fwMedData::Study::sptr study)
 Returns the item representing the study.
 
UIMEDDATAQT_API void setSeriesIcons (const SeriesIconType &seriesIcons)
 Sets the specific icons for series in selector. More...
 
UIMEDDATAQT_API void setInsertMode (bool insert)
 Sets if the selector must be in insert mode.
 

Detailed Description

This class represents the Selector Model.

Definition at line 31 of file SelectorModel.hpp.

Member Enumeration Documentation

Defines item type (STUDY or SERIES), it is used in items data (ITEM_TYPE role).

Enumerator
STUDY 

Type to represent Study/Patient.

SERIES 

Type to represent Series.

Definition at line 45 of file SelectorModel.hpp.

Defines the role of the items data (ITEM_TYPE or UID)

Enumerator
ITEM_TYPE 

Role for the item type (STUDY or SERIES)

UID 

Role for the fwID of the object.

Definition at line 38 of file SelectorModel.hpp.

Member Function Documentation

QModelIndex uiMedDataQt::widget::SelectorModel::getIndex ( const QModelIndex &  index,
int  column 
)

Returns the index in the same row as the given index and at the specified column.

Parameters
[in]indexindex used to get the associated row.
[in]columnthe column of the index to return.

Definition at line 344 of file SelectorModel.cpp.

void uiMedDataQt::widget::SelectorModel::removeSeries ( ::fwMedData::Series::sptr  series)

Removes the Series from the tree. After deletion, if the study is empty, it will be removed.

Parameters
[in]seriesseries to remove from the tree.

Definition at line 336 of file SelectorModel.cpp.

References findSeriesItem().

+ Here is the call graph for this function:

void uiMedDataQt::widget::SelectorModel::setSeriesIcons ( const SeriesIconType seriesIcons)

Sets the specific icons for series in selector.

Parameters
[in]seriesIconsmap<series classname, icon path>

Definition at line 458 of file SelectorModel.cpp.


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