Slicer 5.4
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#include <QItemDelegate>
27
28// qMRML includes
29#include "qMRMLWidgetsExport.h"
30
31class QSortFilterProxyModel;
32class qMRMLColorTableViewPrivate;
33class qMRMLColorModel;
35class vtkMRMLNode;
36
40class QMRML_WIDGETS_EXPORT qMRMLColorTableView : public QTableView
41{
42 Q_OBJECT
46 Q_PROPERTY(bool showOnlyNamedColors READ showOnlyNamedColors WRITE setShowOnlyNamedColors)
47public:
48 qMRMLColorTableView(QWidget *parent=nullptr);
50
51 Q_INVOKABLE vtkMRMLColorNode* mrmlColorNode()const;
52 Q_INVOKABLE qMRMLColorModel* colorModel()const;
53 Q_INVOKABLE QSortFilterProxyModel* sortFilterProxyModel()const;
54
57 Q_INVOKABLE int rowFromColorName(const QString& colorName)const;
60 Q_INVOKABLE int rowFromColorIndex(int colorIndex)const;
61
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
Table view for color table nodes. Edition of color (opening dialog) and opacity (slider popup) is han...
Q_INVOKABLE qMRMLColorModel * colorModel() 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.
Q_INVOKABLE QSortFilterProxyModel * sortFilterProxyModel() const
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.