Slicer  5.1
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qMRMLCheckableNodeComboBox.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Copyright (c) Kitware Inc.
6 
7  See COPYRIGHT.txt
8  or http://www.slicer.org/copyright/copyright.txt for details.
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16  This file was originally developed by Julien Finet, Kitware Inc.
17  and was partially funded by NIH grant 3P41RR013218-12S1
18 
19 ==============================================================================*/
20 
21 #ifndef __qMRMLCheckableNodeComboBox_h
22 #define __qMRMLCheckableNodeComboBox_h
23 
24 // qMRML includes
25 #include "qMRMLNodeComboBox.h"
26 
27 class qMRMLCheckableNodeComboBoxPrivate;
28 
34 class QMRML_WIDGETS_EXPORT qMRMLCheckableNodeComboBox
35  : public qMRMLNodeComboBox
36 {
37  Q_OBJECT
38 public:
41 
44  explicit qMRMLCheckableNodeComboBox(QWidget* parent = nullptr);
45  ~qMRMLCheckableNodeComboBox() override;
46 
49  Q_INVOKABLE QList<vtkMRMLNode*> checkedNodes()const;
50 
53  Q_INVOKABLE QList<vtkMRMLNode*> uncheckedNodes()const;
54 
57  Q_INVOKABLE bool allChecked()const;
58 
61  Q_INVOKABLE bool noneChecked()const;
62 
66  Q_INVOKABLE Qt::CheckState checkState(vtkMRMLNode* node)const;
67  Q_INVOKABLE void setCheckState(vtkMRMLNode* node, Qt::CheckState check);
68 
71  Q_INVOKABLE void setUserCheckable(vtkMRMLNode* node, bool userCheckable);
72 
73 public slots:
75  inline void check(vtkMRMLNode* node);
76 
78  inline void uncheck(vtkMRMLNode* node);
79 
80 signals:
82  void checkedNodesChanged();
83 
84 private:
85  Q_DECLARE_PRIVATE(qMRMLCheckableNodeComboBox);
86  Q_DISABLE_COPY(qMRMLCheckableNodeComboBox);
87 };
88 
89 //-----------------------------------------------------------------------------
91 {
92  this->setCheckState(node, Qt::Checked);
93 }
94 
95 //-----------------------------------------------------------------------------
97 {
98  this->setCheckState(node, Qt::Unchecked);
99 }
100 
101 #endif
Q_INVOKABLE void setCheckState(vtkMRMLNode *node, Qt::CheckState check)
qMRMLNodeComboBox Superclass
Superclass typedef.
void uncheck(vtkMRMLNode *node)
Set the check state of the node to Qt::Unchecked.
Combobox that automatically displays all the nodes of the scene that match filtering criteria...
void check(vtkMRMLNode *node)
Set the check state of the node to Qt::Checked.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167