Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
|
Displays all or a subset (defined by a predicate) of nodes of the Data Storage, and additionally, index 0 is always "please select", indicating no selection, and will hence always return a nullptr mitk::DataNode* if asked for the node at index 0. More...
#include <QmitkDataStorageComboBoxWithSelectNone.h>
Public Member Functions | |
QmitkDataStorageComboBoxWithSelectNone (QWidget *parent=nullptr, bool autoSelectNewNodes=false) | |
Calls base class constructor. More... | |
QmitkDataStorageComboBoxWithSelectNone (mitk::DataStorage *dataStorage, const mitk::NodePredicateBase *predicate, QWidget *parent=nullptr, bool autoSelectNewNodes=false) | |
Calls base class constructor. More... | |
~QmitkDataStorageComboBoxWithSelectNone () override | |
Nothing to do. More... | |
int | Find (const mitk::DataNode *dataNode) const override |
Searches for a given node, returning the index if found. More... | |
mitk::DataNode::Pointer | GetNode (int index) const override |
Retrieves the node at a given index, where if index is zero, will always return nullptr. More... | |
mitk::DataNode::Pointer | GetSelectedNode () const override |
Returns the selected DataNode or nullptr if there is none, or the current index is zero. More... | |
virtual void | SetSelectedNode (const mitk::DataNode::Pointer &node) |
Sets the combo box to the index that contains the specified node, or 0 if the node cannot be found. More... | |
void | RemoveNode (int index) override |
Removes a node from the ComboBox at a specified index (if the index exists). Gets called when a DataStorage Remove Event was thrown. More... | |
void | SetNode (int index, const mitk::DataNode *dataNode) override |
Set a DataNode in the ComboBox at the specified index (if the index exists). Internally the method just calls InsertNode(unsigned int) More... | |
virtual QString | currentValue () const |
Get the current file path. More... | |
virtual void | setCurrentValue (const QString &path) |
Set the current file path. More... | |
void | SetZeroEntryText (const QString &zeroEntryString) |
Set the string that will be present on index 0. More... | |
![]() | |
QmitkDataStorageComboBox (QWidget *parent=nullptr, bool autoSelectNewNodes=false) | |
Ctor for an empty combobox. Use setDataStorage and setPredicate afterwards. More... | |
QmitkDataStorageComboBox (mitk::DataStorage *dataStorage, const mitk::NodePredicateBase *predicate, QWidget *parent=nullptr, bool autoSelectNewNodes=false) | |
Ctor for constructing QmitkDataStorageComboBox with given DataStorageComboBox and given predicate. More... | |
~QmitkDataStorageComboBox () override | |
Standard Dtor. Nothing to do here. More... | |
mitk::DataStorage::Pointer | GetDataStorage () const |
Get the DataStorage this ComboBox listens to. More... | |
const mitk::NodePredicateBase::ConstPointer | GetPredicate () const |
Return the predicate (may be nullptr) that is responsible for the dataNode selection of this ComboBox. More... | |
mitk::DataStorage::SetOfObjects::ConstPointer | GetNodes () const |
Returns all nodes that are stored in this combobox. More... | |
virtual bool | GetAutoSelectNewItems () |
void | SetDataStorage (mitk::DataStorage *dataStorage) |
Set the DataStorage this ComboBox should listen to. More... | |
void | SetPredicate (const mitk::NodePredicateBase *predicate) |
Set the predicate for this ComboBox. (QmitkDataStorageComboBox is now owner of the predicate) More... | |
virtual void | AddNode (const mitk::DataNode *dataNode) |
virtual void | RemoveNode (const mitk::DataNode *dataNode) |
virtual void | SetNode (const mitk::DataNode *dataNode, const mitk::DataNode *otherDataNode) |
virtual void | SetAutoSelectNewItems (bool autoSelectNewItems) |
virtual void | OnPropertyListChanged (const itk::Object *caller, const itk::EventObject &event) |
Called when the name property of the node was modified. More... | |
Static Public Attributes | |
static const QString | ZERO_ENTRY_STRING |
Stores the string that will be present on index 0, currently equal to "please select". More... | |
Protected Member Functions | |
bool | HasIndex (unsigned int index) const |
Checks if the given index is within range. More... | |
void | InsertNode (int index, const mitk::DataNode *dataNode) override |
Inserts a new node at the given index, unless index is 0, which is silently ignored. More... | |
void | Reset () override |
Reset function whenever datastorage or predicate changes. More... | |
![]() | |
bool | HasIndex (unsigned int index) const |
Checks if the given index is within the range of the m_Nodes vector. More... | |
void | Init () |
Init-function this class with the given data storage and predicate. This function is called by all ctors. More... | |
void | RemoveNodeAndPropertyLists (int index) |
virtual void | UpdateComboBoxText (const mitk::PropertyList *) |
Properties | |
mitkDataNodePtr | SelectedNode |
QString | currentValue |
Additional Inherited Members | |
![]() | |
void | SetSelectedNode (const mitk::DataNode::Pointer &node) |
Slot for signal when user wants to set a node as current selected node. More... | |
![]() | |
void | OnSelectionChanged (const mitk::DataNode *) |
Throw a signal when the data node selection changed. More... | |
![]() | |
void | OnCurrentIndexChanged (int) |
Slot for signal when the user selects another item. More... | |
![]() | |
mitk::WeakPointer< mitk::DataStorage > | m_DataStorage |
mitk::NodePredicateBase::ConstPointer | m_Predicate |
Holds the predicate that is responsible for the dataNode selection of this ComboBox. If the predicate is 0, every dataNode will be selected. More... | |
std::vector< mitk::DataNode * > | m_Nodes |
std::vector< long > | m_DataNodePropertyListObserverTags |
Holds the tags of the data node property observers. More... | |
std::vector< long > | m_BaseDatapropertyListObserverTags |
Holds the tags of the base data property observers. More... | |
bool | m_BlockEvents |
Event function guard. Each function which is called by an event mechanism first checks if this is true in order to avoid endless loops. More... | |
bool | m_AutoSelectNewNodes |
If set to "true" new Nodes will be automatically selected. More... | |
Displays all or a subset (defined by a predicate) of nodes of the Data Storage, and additionally, index 0 is always "please select", indicating no selection, and will hence always return a nullptr mitk::DataNode* if asked for the node at index 0.
Definition at line 33 of file QmitkDataStorageComboBoxWithSelectNone.h.
QmitkDataStorageComboBoxWithSelectNone::QmitkDataStorageComboBoxWithSelectNone | ( | QWidget * | parent = nullptr , |
bool | autoSelectNewNodes = false |
||
) |
Calls base class constructor.
Definition at line 18 of file QmitkDataStorageComboBoxWithSelectNone.cpp.
QmitkDataStorageComboBoxWithSelectNone::QmitkDataStorageComboBoxWithSelectNone | ( | mitk::DataStorage * | dataStorage, |
const mitk::NodePredicateBase * | predicate, | ||
QWidget * | parent = nullptr , |
||
bool | autoSelectNewNodes = false |
||
) |
Calls base class constructor.
Definition at line 24 of file QmitkDataStorageComboBoxWithSelectNone.cpp.
|
override |
Nothing to do.
Definition at line 32 of file QmitkDataStorageComboBoxWithSelectNone.cpp.
|
virtual |
Get the current file path.
Referenced by SetZeroEntryText().
|
overridevirtual |
Searches for a given node, returning the index if found.
dataNode | an mitk::DataNode, can be nullptr. |
Reimplemented from QmitkDataStorageComboBox.
Definition at line 36 of file QmitkDataStorageComboBoxWithSelectNone.cpp.
References QmitkDataStorageComboBox::Find().
Referenced by SetSelectedNode().
|
overridevirtual |
Retrieves the node at a given index, where if index is zero, will always return nullptr.
index | An integer between 0 and n = number of nodes. |
Reimplemented from QmitkDataStorageComboBox.
Definition at line 46 of file QmitkDataStorageComboBoxWithSelectNone.cpp.
References HasIndex(), and QmitkDataStorageComboBox::m_Nodes.
Referenced by GetSelectedNode().
|
overridevirtual |
Returns the selected DataNode or nullptr if there is none, or the current index is zero.
Reimplemented from QmitkDataStorageComboBox.
Definition at line 60 of file QmitkDataStorageComboBoxWithSelectNone.cpp.
References GetNode().
|
protected |
Checks if the given index is within range.
Definition at line 103 of file QmitkDataStorageComboBoxWithSelectNone.cpp.
References QmitkDataStorageComboBox::m_Nodes.
Referenced by GetNode(), RemoveNode(), and SetNode().
|
overrideprotectedvirtual |
Inserts a new node at the given index, unless index is 0, which is silently ignored.
Reimplemented from QmitkDataStorageComboBox.
Definition at line 108 of file QmitkDataStorageComboBoxWithSelectNone.cpp.
References QmitkDataStorageComboBox::InsertNode().
|
overridevirtual |
Removes a node from the ComboBox at a specified index (if the index exists). Gets called when a DataStorage Remove Event was thrown.
Reimplemented from QmitkDataStorageComboBox.
Definition at line 77 of file QmitkDataStorageComboBoxWithSelectNone.cpp.
References HasIndex(), and QmitkDataStorageComboBox::RemoveNodeAndPropertyLists().
|
overrideprotectedvirtual |
Reset function whenever datastorage or predicate changes.
Reimplemented from QmitkDataStorageComboBox.
Definition at line 116 of file QmitkDataStorageComboBoxWithSelectNone.cpp.
References QmitkDataStorageComboBox::Reset(), and ZERO_ENTRY_STRING.
|
virtual |
Set the current file path.
Definition at line 133 of file QmitkDataStorageComboBoxWithSelectNone.cpp.
|
overridevirtual |
Set a DataNode in the ComboBox at the specified index (if the index exists). Internally the method just calls InsertNode(unsigned int)
Reimplemented from QmitkDataStorageComboBox.
Definition at line 87 of file QmitkDataStorageComboBoxWithSelectNone.cpp.
References mitk::DataNode::GetName(), HasIndex(), QmitkDataStorageComboBox::InsertNode(), and QmitkDataStorageComboBox::m_Nodes.
|
virtual |
Sets the combo box to the index that contains the specified node, or 0 if the node cannot be found.
Definition at line 65 of file QmitkDataStorageComboBoxWithSelectNone.cpp.
References Find().
void QmitkDataStorageComboBoxWithSelectNone::SetZeroEntryText | ( | const QString & | zeroEntryString | ) |
Set the string that will be present on index 0.
Definition at line 122 of file QmitkDataStorageComboBoxWithSelectNone.cpp.
References currentValue().
|
static |
Stores the string that will be present on index 0, currently equal to "please select".
Definition at line 65 of file QmitkDataStorageComboBoxWithSelectNone.h.
Referenced by Reset().
|
readwrite |
Definition at line 38 of file QmitkDataStorageComboBoxWithSelectNone.h.
|
readwrite |
Definition at line 37 of file QmitkDataStorageComboBoxWithSelectNone.h.