21 #ifndef __qMRMLNodeComboBox_h 22 #define __qMRMLNodeComboBox_h 29 #include "qMRMLWidgetsExport.h" 31 class qMRMLNodeComboBoxPrivate;
59 Q_PROPERTY(QString currentNodeID READ currentNodeID WRITE setCurrentNodeID NOTIFY currentNodeIDChanged DESIGNABLE
false)
60 Q_PROPERTY(QString currentNodeId READ currentNodeId WRITE setCurrentNode DESIGNABLE false)
61 Q_PROPERTY(QStringList nodeTypes READ nodeTypes WRITE setNodeTypes)
62 Q_PROPERTY(
bool showHidden READ showHidden WRITE setShowHidden)
63 Q_PROPERTY(
bool showChildNodeTypes READ showChildNodeTypes WRITE setShowChildNodeTypes)
64 Q_PROPERTY(QStringList hideChildNodeTypes READ hideChildNodeTypes WRITE setHideChildNodeTypes)
66 Q_PROPERTY(QString baseName READ baseName WRITE setBaseName)
73 Q_PROPERTY(
bool noneEnabled READ noneEnabled WRITE setNoneEnabled)
74 Q_PROPERTY(
bool addEnabled READ addEnabled WRITE setAddEnabled)
75 Q_PROPERTY(
bool removeEnabled READ removeEnabled WRITE setRemoveEnabled)
76 Q_PROPERTY(
bool editEnabled READ editEnabled WRITE setEditEnabled)
77 Q_PROPERTY(
bool renameEnabled READ renameEnabled WRITE setRenameEnabled)
85 Q_PROPERTY(QString interactionNodeSingletonTag READ interactionNodeSingletonTag WRITE setInteractionNodeSingletonTag)
87 Q_PROPERTY(
bool selectNodeUponCreation READ selectNodeUponCreation WRITE setSelectNodeUponCreation)
91 Q_PROPERTY(QString noneDisplay READ noneDisplay WRITE setNoneDisplay)
93 Q_PROPERTY(QComboBox::SizeAdjustPolicy sizeAdjustPolicy READ sizeAdjustPolicy WRITE setSizeAdjustPolicy)
111 QStringList nodeTypes()const;
112 void setNodeTypes(const QStringList& nodeTypes);
116 inline
void setShowHidden(
bool);
117 inline
bool showHidden()const;
125 inline
void setShowChildNodeTypes(
bool show);
126 inline
bool showChildNodeTypes()const;
131 inline
void setHideChildNodeTypes(const QStringList& nodeTypes);
132 inline QStringList hideChildNodeTypes()const;
144 Q_INVOKABLE
void addAttribute(const QString& nodeType,
145 const QString& attributeName,
146 const QVariant& attributeValue = QVariant());
149 Q_INVOKABLE
void removeAttribute(const QString& nodeType,
150 const QString& attributeName);
156 void setBaseName(const QString& baseName, const QString& nodeType = "");
157 QString baseName(const QString& nodeType = "")const;
163 Q_INVOKABLE
void setNodeTypeLabel(const QString& label, const QString& nodeType);
164 Q_INVOKABLE QString nodeTypeLabel(const QString& nodeType)const;
168 Q_INVOKABLE
int nodeCount()const;
173 Q_INVOKABLE
vtkMRMLNode* nodeFromIndex(
int index)const;
180 QString currentNodeID()const;
184 Q_INVOKABLE QString currentNodeId()const;
189 bool selectNodeUponCreation()const;
190 void setSelectNodeUponCreation(
bool value);
194 bool noneEnabled()const;
197 void setNoneEnabled(
bool enable);
201 bool addEnabled()const;
202 void setAddEnabled(
bool enable);
206 bool removeEnabled()const;
207 void setRemoveEnabled(
bool enable);
211 bool editEnabled()const;
212 void setEditEnabled(
bool enable);
215 bool renameEnabled()const;
216 void setRenameEnabled(
bool enable);
220 QString noneDisplay()const;
224 void setNoneDisplay(const QString& displayName);
232 QAbstractItemModel* model()const;
255 QComboBox::SizeAdjustPolicy sizeAdjustPolicy()const;
256 void setSizeAdjustPolicy(QComboBox::SizeAdjustPolicy policy);
267 Q_INVOKABLE virtual
void addMenuAction(QAction *newAction);
269 virtual QString interactionNodeSingletonTag()const;
270 virtual
void setInteractionNodeSingletonTag(const QString& tag);
282 void setCurrentNode(const QString& nodeID);
286 void setCurrentNodeID(const QString& nodeID);
292 void setCurrentNodeIndex(
int index);
315 virtual
void removeCurrentNode();
318 virtual
void editCurrentNode();
323 virtual
void renameCurrentNode();
332 void currentNodeIDChanged(const QString&
id);
347 void currentNodeChanged(
bool validNode);
367 void currentNodeRenamed(const QString& newName);
376 QAbstractItemModel* rootModel()const;
378 void setComboBox(QComboBox* comboBox);
382 QComboBox* comboBox()const;
384 void changeEvent(QEvent* event) override;
387 void activateExtraItem(const QModelIndex& index);
388 void emitCurrentNodeChanged();
389 void emitNodeActivated(
int currentIndex);
390 void emitNodesAdded(const QModelIndex & parent,
int start,
int end);
391 void emitNodesAboutToBeRemoved(const QModelIndex & parent,
int start,
int end);
392 void refreshIfCurrentNodeHidden();
395 QScopedPointer<qMRMLNodeComboBoxPrivate> d_ptr;
411 return this->sortFilterProxyModel()->showHidden();
417 this->sortFilterProxyModel()->setShowChildNodeTypes(show);
423 return this->sortFilterProxyModel()->showChildNodeTypes();
429 this->sortFilterProxyModel()->setHideChildNodeTypes(_nodeTypes);
435 return this->sortFilterProxyModel()->hideChildNodeTypes();
void setHideChildNodeTypes(const QStringList &nodeTypes)
QStringList hideChildNodeTypes() const
A set of MRML Nodes that supports serialization and undo/redo.
bool showChildNodeTypes() const
void setShowChildNodeTypes(bool show)
Combobox that automatically displays all the nodes of the scene that match filtering criteria...
Abstract Superclass for all specific types of MRML nodes.