27 bool autoSelectNewNodes)
62 return this->
GetNode(this->currentIndex());
67 int index =
Find(node);
74 this->setCurrentIndex(index);
79 if(index > 0 && this->
HasIndex(index))
83 this->removeItem(index);
89 if (index > 0 && this->
HasIndex(index))
92 if (dataNode ==
m_Nodes.at(index - 1))
94 this->setItemText(index, QString::fromStdString(dataNode->
GetName()));
124 this->setItemText(0, zeroEntryString);
125 this->setCurrentIndex(0);
130 return m_CurrentPath;
135 m_CurrentPath = path;
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...
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 ju...
Data management class that handles 'was created by' relations.
mitk::DataNode::Pointer GetSelectedNode() const override
Returns the selected DataNode or nullptr if there is none, or the current index is zero...
Displays all or a subset (defined by a predicate) of nodes of the Data Storage.
std::vector< mitk::DataNode * > m_Nodes
virtual void InsertNode(int index, const mitk::DataNode *dataNode)
Inserts a new node at the given index. If the index does not exist, the data node is simply appended ...
~QmitkDataStorageComboBoxWithSelectNone() override
Nothing to do.
static const QString ZERO_ENTRY_STRING
Stores the string that will be present on index 0, currently equal to "please select".
void RemoveNode(int index) override
Removes a node from the ComboBox at a specified index (if the index exists). Gets called when a DataS...
bool HasIndex(unsigned int index) const
Checks if the given index is within range.
mitk::DataNode::Pointer GetNode(int index) const override
Retrieves the node at a given index, where if index is zero, will always return nullptr.
virtual void setCurrentValue(const QString &path)
Set the current file path.
void Reset() override
Reset function whenever datastorage or predicate changes.
virtual QString currentValue() const
Get the current file path.
void RemoveNodeAndPropertyLists(int index)
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.
virtual int Find(const mitk::DataNode *dataNode) const
Searches for a given node and returns a valid index or -1 if the node was not found.
virtual void Reset()
Reset function whenever data storage or predicate changes.
void SetZeroEntryText(const QString &zeroEntryString)
Set the string that will be present on index 0.
Interface for evaluation conditions used in the DataStorage class GetSubset() method.
QmitkDataStorageComboBoxWithSelectNone(QWidget *parent=nullptr, bool autoSelectNewNodes=false)
Calls base class constructor.
Class for nodes of the DataTree.
bool GetName(std::string &nodeName, const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="name") const
Convenience access method for accessing the name of an object (instance of StringProperty with proper...
int Find(const mitk::DataNode *dataNode) const override
Searches for a given node, returning the index if found.