Slicer  5.3
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qMRMLColorListView.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 __qMRMLColorListView_h
22 #define __qMRMLColorListView_h
23 
24 // Qt includes
25 #include <QListView>
26 
27 // qMRML includes
28 #include "qMRMLWidgetsExport.h"
29 
30 class QSortFilterProxyModel;
31 class qMRMLColorListViewPrivate;
32 class qMRMLColorModel;
33 class vtkMRMLColorNode;
34 class vtkMRMLNode;
35 
36 class QMRML_WIDGETS_EXPORT qMRMLColorListView : public QListView
37 {
38  Q_OBJECT
39  Q_PROPERTY(bool showOnlyNamedColors READ showOnlyNamedColors WRITE setShowOnlyNamedColors)
40 public:
41  qMRMLColorListView(QWidget *parent=nullptr);
42  ~qMRMLColorListView() override;
43 
44  vtkMRMLColorNode* mrmlColorNode()const;
45  qMRMLColorModel* colorModel()const;
46  QSortFilterProxyModel* sortFilterProxyModel()const;
47 
48  bool showOnlyNamedColors()const;
49 
50 public slots:
51  void setMRMLColorNode(vtkMRMLColorNode* colorNode);
53  void setMRMLColorNode(vtkMRMLNode* colorNode);
54 
55  void setShowOnlyNamedColors(bool);
56 
57 signals:
60  void colorSelected(int index);
61  void colorSelected(const QColor& color);
62  void colorSelected(const QString& name);
63 
64 protected slots:
65  void currentChanged(const QModelIndex&, const QModelIndex&) override;
66 
67 protected:
68  QScopedPointer<qMRMLColorListViewPrivate> d_ptr;
69 
70 private:
71  Q_DECLARE_PRIVATE(qMRMLColorListView);
72  Q_DISABLE_COPY(qMRMLColorListView);
73 };
74 
75 #endif
Abstract MRML node to represent color information.
QScopedPointer< qMRMLColorListViewPrivate > d_ptr
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167