fw4spl
|
This class represents the Selector Model. More...
#include <SelectorModel.hpp>
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. | |
This class represents the Selector Model.
Definition at line 31 of file SelectorModel.hpp.
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.
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.
[in] | index | index used to get the associated row. |
[in] | column | the 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.
[in] | series | series to remove from the tree. |
Definition at line 336 of file SelectorModel.cpp.
References findSeriesItem().
void uiMedDataQt::widget::SelectorModel::setSeriesIcons | ( | const SeriesIconType & | seriesIcons | ) |
Sets the specific icons for series in selector.
[in] | seriesIcons | map<series classname, icon path> |
Definition at line 458 of file SelectorModel.cpp.