Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
qMRMLColorTableView.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 __qMRMLColorTableView_h
22#define __qMRMLColorTableView_h
23
24// Qt includes
25#include <QTableView>
26
27// Colors includes
28#include "qSlicerColorsModuleWidgetsExport.h"
29
30class QSortFilterProxyModel;
31class qMRMLColorTableViewPrivate;
32class qMRMLColorModel;
35class vtkMRMLNode;
36
40class Q_SLICER_MODULE_COLORS_WIDGETS_EXPORT qMRMLColorTableView : public QTableView
41{
42 Q_OBJECT
47public:
48 qMRMLColorTableView(QWidget* parent = nullptr);
50
51 Q_INVOKABLE vtkMRMLColorNode* mrmlColorNode() const;
52 Q_INVOKABLE qMRMLColorModel* colorModel() const;
54
57 Q_INVOKABLE int rowFromColorName(const QString& colorName) const;
60 Q_INVOKABLE int rowFromColorIndex(int colorIndex) const;
61
62 bool showOnlyNamedColors() const;
63
64public slots:
67 void setMRMLColorNode(vtkMRMLNode* colorNode);
68
70
71protected:
72 QScopedPointer<qMRMLColorTableViewPrivate> d_ptr;
73
74private:
75 Q_DECLARE_PRIVATE(qMRMLColorTableView);
76 Q_DISABLE_COPY(qMRMLColorTableView);
77};
78
79#endif
Q_INVOKABLE qMRMLColorModel * colorModel() const
Q_INVOKABLE qMRMLSortFilterColorProxyModel * sortFilterProxyModel() const
Q_INVOKABLE int rowFromColorName(const QString &colorName) const
bool showOnlyNamedColors() const
void setMRMLColorNode(vtkMRMLNode *colorNode)
Utility function to simply connect signals/slots with Qt Designer.
QScopedPointer< qMRMLColorTableViewPrivate > d_ptr
Q_INVOKABLE vtkMRMLColorNode * mrmlColorNode() const
void setMRMLColorNode(vtkMRMLColorNode *colorNode)
qMRMLColorTableView(QWidget *parent=nullptr)
~qMRMLColorTableView() override
Q_INVOKABLE int rowFromColorIndex(int colorIndex) const
void setShowOnlyNamedColors(bool)
Abstract MRML node to represent color information.
Abstract Superclass for all specific types of MRML nodes.