Slicer 5.4
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
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
30class QSortFilterProxyModel;
31class qMRMLColorListViewPrivate;
32class qMRMLColorModel;
34class vtkMRMLNode;
35
36class QMRML_WIDGETS_EXPORT qMRMLColorListView : public QListView
37{
38 Q_OBJECT
39 Q_PROPERTY(bool showOnlyNamedColors READ showOnlyNamedColors WRITE setShowOnlyNamedColors)
40public:
41 qMRMLColorListView(QWidget *parent=nullptr);
43
46 QSortFilterProxyModel* sortFilterProxyModel()const;
47
49
50public slots:
53 void setMRMLColorNode(vtkMRMLNode* colorNode);
54
56
57signals:
60 void colorSelected(int index);
61 void colorSelected(const QColor& color);
62 void colorSelected(const QString& name);
63
64protected slots:
65 void currentChanged(const QModelIndex&, const QModelIndex&) override;
66
67protected:
68 QScopedPointer<qMRMLColorListViewPrivate> d_ptr;
69
70private:
71 Q_DECLARE_PRIVATE(qMRMLColorListView);
72 Q_DISABLE_COPY(qMRMLColorListView);
73};
74
75#endif
bool showOnlyNamedColors() const
void colorSelected(const QString &name)
~qMRMLColorListView() override
qMRMLColorModel * colorModel() const
void setMRMLColorNode(vtkMRMLNode *colorNode)
Utility function to simply connect signals/slots with Qt Designer.
void currentChanged(const QModelIndex &, const QModelIndex &) override
vtkMRMLColorNode * mrmlColorNode() const
void setShowOnlyNamedColors(bool)
qMRMLColorListView(QWidget *parent=nullptr)
QSortFilterProxyModel * sortFilterProxyModel() const
void colorSelected(int index)
QScopedPointer< qMRMLColorListViewPrivate > d_ptr
void setMRMLColorNode(vtkMRMLColorNode *colorNode)
void colorSelected(const QColor &color)
Abstract MRML node to represent color information.
Abstract Superclass for all specific types of MRML nodes.