Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
qMRMLLabelComboBox.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 Johan Andruejol, Kitware Inc.
17 and was partially funded by NIH grant 3P41RR013218-12S1
18
19==============================================================================*/
20
21#ifndef __qMRMLLabelComboBox_h
22#define __qMRMLLabelComboBox_h
23
24// CTK includes
25#include <ctkPimpl.h>
26#include <ctkVTKObject.h>
27
28// qMRML includes
29#include "qMRMLWidgetsExport.h"
30#include "qMRMLWidget.h"
31
32class vtkMRMLNode;
34class qMRMLLabelComboBoxPrivate;
35
36class QMRML_WIDGETS_EXPORT qMRMLLabelComboBox : public qMRMLWidget
37{
38 Q_OBJECT
39 QVTK_OBJECT
40 Q_PROPERTY(bool noneEnabled READ noneEnabled WRITE setNoneEnabled)
41 Q_PROPERTY(int currentColor READ currentColor WRITE setCurrentColor NOTIFY currentColorChanged USER true)
42 Q_PROPERTY(QString currentColorName READ currentColorName WRITE setCurrentColor NOTIFY currentColorChanged STORED false)
46
47public:
48
50
53 explicit qMRMLLabelComboBox(QWidget* newParent = nullptr);
54 ~qMRMLLabelComboBox() override;
55
58 bool noneEnabled()const;
59 void setNoneEnabled(bool enable);
60
62 bool colorNameVisible() const;
63 void setColorNameVisible(bool visible);
64
66 bool labelValueVisible() const;
67 void setLabelValueVisible(bool visible);
68
69 virtual void printAdditionalInfo();
70
72
73 int currentColor()const;
74 QString currentColorName()const;
75
77 void setMaximumColorCount(int maximum);
78
79public slots:
80
81 void setMRMLColorNode(vtkMRMLNode * newMRMLColorNode);
82
83 void setCurrentColor(int index);
84 void setCurrentColor(const QString& colorName);
85
87
88signals:
89
90 void currentColorChanged(const QColor& color);
91 void currentColorChanged(const QString& name);
92 void currentColorChanged(int index);
93
94private slots:
95
96 void onCurrentIndexChanged(int index);
97
98protected:
99 QScopedPointer<qMRMLLabelComboBoxPrivate> d_ptr;
100private:
101 Q_DECLARE_PRIVATE(qMRMLLabelComboBox);
102 Q_DISABLE_COPY(qMRMLLabelComboBox);
103};
104
105#endif
void currentColorChanged(const QColor &color)
void setMaximumColorCount(int maximum)
virtual void printAdditionalInfo()
void setCurrentColor(int index)
void setMRMLColorNode(vtkMRMLNode *newMRMLColorNode)
QScopedPointer< qMRMLLabelComboBoxPrivate > d_ptr
qMRMLLabelComboBox(QWidget *newParent=nullptr)
void setLabelValueVisible(bool visible)
void setNoneEnabled(bool enable)
void updateWidgetFromMRML()
vtkMRMLColorNode * mrmlColorNode() const
void setColorNameVisible(bool visible)
QVTK_OBJECTbool noneEnabled
qMRMLWidget(QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags())
Abstract MRML node to represent color information.
Abstract Superclass for all specific types of MRML nodes.