Slicer  4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerTableColumnPropertiesWidget.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Copyright (c) Laboratory for Percutaneous Surgery (PerkLab)
4  Queen's University, Kingston, ON, Canada. All Rights Reserved.
5 
6  See COPYRIGHT.txt
7  or http://www.slicer.org/copyright/copyright.txt for details.
8 
9  Unless required by applicable law or agreed to in writing, software
10  distributed under the License is distributed on an "AS IS" BASIS,
11  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  See the License for the specific language governing permissions and
13  limitations under the License.
14 
15  This file was originally developed by Matthew Holden, PerkLab, Queen's University
16  and was supported through the Applied Cancer Research Unit program of Cancer Care
17  Ontario with funds provided by the Ontario Ministry of Health and Long-Term Care
18 
19 ==============================================================================*/
20 
21 #ifndef __qSlicerTableColumnPropertiesWidget_h
22 #define __qSlicerTableColumnPropertiesWidget_h
23 
24 // Qt includes
25 #include "qSlicerWidget.h"
26 
27 #include "qMRMLUtils.h"
28 
29 // Tables Widgets includes
30 #include "qSlicerTablesModuleWidgetsExport.h"
31 #include "ui_qSlicerTableColumnPropertiesWidget.h"
32 
33 
34 class qSlicerTableColumnPropertiesWidgetPrivate;
35 class vtkMRMLTableNode;
36 class qMRMLTableView;
37 
39 class Q_SLICER_MODULE_TABLES_WIDGETS_EXPORT
41 {
42  Q_OBJECT
43  Q_PROPERTY(bool columnNameVisible READ columnNameVisible WRITE setColumnNameVisible)
44  Q_PROPERTY(bool confirmTypeChange READ confirmTypeChange WRITE setConfirmTypeChange)
45 
46 public:
48  qSlicerTableColumnPropertiesWidget(QWidget *parent=nullptr);
50 
52  Q_INVOKABLE vtkMRMLTableNode* mrmlTableNode()const;
53 
54  Q_INVOKABLE QStringList mrmlTableColumnNames();
55 
57  Q_INVOKABLE void setSelectionFromMRMLTableView(qMRMLTableView* tableView);
58 
59  Q_INVOKABLE bool columnNameVisible() const;
60  Q_INVOKABLE bool confirmTypeChange() const;
61 
62  Q_INVOKABLE void setColumnProperty(QString propertyName, QString propertyValue);
63  Q_INVOKABLE QString columnProperty(QString propertyName) const;
64 
65 public slots:
66 
67  void setMRMLScene(vtkMRMLScene* scene) override;
68 
69  void setMRMLTableNode(vtkMRMLTableNode* tableNode);
71  void setMRMLTableNode(vtkMRMLNode* tableNode);
72 
73  void setMRMLTableColumnName(const QString& selectedColumn);
74  void setMRMLTableColumnNames(const QStringList& selectedColumns);
75 
77  void setColumnNameVisible(bool);
78 
81  void setConfirmTypeChange(bool);
82 
83 protected slots:
84 
86  void tableViewSelectionChanged();
87 
88  void onDataTypeChanged(const QString&);
89 
90  void onPropertyChanged(const QString&);
91 
92  void onApplyTypeChange();
93  void onCancelTypeChange();
94 
96  void updateWidget();
97 
98 signals:
99 
102  void updateFinished();
103 
104 protected:
105  QScopedPointer<qSlicerTableColumnPropertiesWidgetPrivate> d_ptr;
106 
107  virtual void setup();
108 
109 private:
110  Q_DECLARE_PRIVATE(qSlicerTableColumnPropertiesWidget);
111  Q_DISABLE_COPY(qSlicerTableColumnPropertiesWidget);
112 
113 };
114 
115 #endif
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:61
Spreadsheet view for table nodes. Allow view/edit of a vtkMRMLTableNode.
MRML node to represent a table object.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167