fw4spl
uiMedDataQt::widget::Selector Class Reference

This selector represents the Series in a hierarchical view (Study/Patient->Series). More...

#include <Selector.hpp>

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

Public Types

typedef QVector< ::fwMedData::Series::sptr > SeriesVectorType
 
typedef SelectorModel::SeriesIconType SeriesIconType
 Map associating icons to series (map<series classname, icon path>)
 

Signals

void selectSeries (QVector< ::fwMedData::Series::sptr > selection, QVector< ::fwMedData::Series::sptr > deselection)
 Signal emitted when the selection change. More...
 
void removeSeries (QVector< ::fwMedData::Series::sptr > selection)
 Signal emitted when series are deleted. More...
 

Public Member Functions

UIMEDDATAQT_API Selector (QWidget *parent=0)
 Constructor. Init tree view.
 
UIMEDDATAQT_API ~Selector ()
 Destrucotr.
 
UIMEDDATAQT_API void clear ()
 Clear all items in the tree.
 
UIMEDDATAQT_API void addSeries (::fwMedData::Series::sptr series)
 Adds the Series in the tree. If the associated study already exists in the tree, the series is added to this study. More...
 
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 SelectorModel::ItemType getItemType (const QModelIndex &index)
 Returns the type of the item (SERIES or STUDY)
 
UIMEDDATAQT_API void keyPressEvent (QKeyEvent *event)
 Catch the delete key event and remove the selected items.
 
UIMEDDATAQT_API void setSeriesIcons (const SeriesIconType &seriesIcons)
 Sets the specific icons for series in selector. More...
 
UIMEDDATAQT_API void setAllowedRemove (bool allowed)
 Allows removing items or not.
 
UIMEDDATAQT_API void setInsertMode (bool insert)
 Sets if the selector must be in insert mode.
 

Protected Slots

void selectionChanged (const QItemSelection &selected, const QItemSelection &deselected)
 Slot called when the selection changed. Emits a signal containing the new selected/deselected series. If a Study is selected, no series are added in signal. More...
 

Protected Member Functions

SeriesVectorType getSeries (const QItemSelection &selection)
 Returns all the Series associated to the selection. More...
 
SeriesVectorType getSeries (const QModelIndexList &indexList)
 Returns all the Series associated to the selection. More...
 
QModelIndexList getStudyIndexes (const QModelIndexList &indexList)
 Returns all the study indexes contained in the given indexList.
 
SeriesVectorType getSeriesFromStudyIndex (const QModelIndex &index)
 Returns all the series associated with the study index.
 
void deleteSelection ()
 Deletes the selected items and notify the deleted series.
 

Detailed Description

This selector represents the Series in a hierarchical view (Study/Patient->Series).

Definition at line 34 of file Selector.hpp.

Member Function Documentation

void uiMedDataQt::widget::Selector::addSeries ( ::fwMedData::Series::sptr  series)

Adds the Series in the tree. If the associated study already exists in the tree, the series is added to this study.

Parameters
[in]seriesseries to add in the tree.

Definition at line 64 of file Selector.cpp.

Selector::SeriesVectorType uiMedDataQt::widget::Selector::getSeries ( const QItemSelection &  selection)
protected

Returns all the Series associated to the selection.

Note
If a study is selected, return an empty selection.

Definition at line 105 of file Selector.cpp.

Referenced by deleteSelection(), and selectionChanged().

+ Here is the caller graph for this function:

Selector::SeriesVectorType uiMedDataQt::widget::Selector::getSeries ( const QModelIndexList &  indexList)
protected

Returns all the Series associated to the selection.

Note
It ignores the studies.

Definition at line 116 of file Selector.cpp.

References fwTools::fwID::getObject(), uiMedDataQt::widget::SelectorModel::ITEM_TYPE, uiMedDataQt::widget::SelectorModel::SERIES, and uiMedDataQt::widget::SelectorModel::UID.

+ Here is the call graph for this function:

void uiMedDataQt::widget::Selector::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 78 of file Selector.cpp.

Referenced by deleteSelection().

+ Here is the caller graph for this function:

void uiMedDataQt::widget::Selector::removeSeries ( QVector< ::fwMedData::Series::sptr >  selection)
signal

Signal emitted when series are deleted.

Parameters
selectioncontains the deleted series.
void uiMedDataQt::widget::Selector::selectionChanged ( const QItemSelection &  selected,
const QItemSelection &  deselected 
)
protectedslot

Slot called when the selection changed. Emits a signal containing the new selected/deselected series. If a Study is selected, no series are added in signal.

Parameters
selectedcontains the new selected items.
deselectedcontains the new deselected items.
Note
selection and deselection contain only the change of selection. The items always selected or deselected don't appear in this selection/deselection.

Definition at line 92 of file Selector.cpp.

References getSeries(), and selectSeries().

+ Here is the call graph for this function:

void uiMedDataQt::widget::Selector::selectSeries ( QVector< ::fwMedData::Series::sptr >  selection,
QVector< ::fwMedData::Series::sptr >  deselection 
)
signal

Signal emitted when the selection change.

Parameters
selectioncontains the new selection of series.
deselectioncontains the new deselection of series.
Note
selection and deselection contain only the change of selection. The series always selected or deselected don't appear in this selection/deselection.

Referenced by selectionChanged().

+ Here is the caller graph for this function:

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

Sets the specific icons for series in selector.

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

Definition at line 211 of file Selector.cpp.


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