Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
qMRMLTableView.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Program: 3D Slicer
4
5 Portions (c) Copyright 2015 Brigham and Women's Hospital (BWH) All Rights Reserved.
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 Andras Lasso (PerkLab, Queen's
17 University) and Kevin Wang (Princess Margaret Hospital, Toronto) and was
18 supported through OCAIRO and the Applied Cancer Research Unit program of
19 Cancer Care Ontario.
20
21==============================================================================*/
22
23#ifndef __qMRMLTableView_h
24#define __qMRMLTableView_h
25
26// Qt includes
27#include <QTableView>
28
29// qMRML includes
30#include "qMRMLWidgetsExport.h"
31
32class QSortFilterProxyModel;
33class qMRMLTableViewPrivate;
34class qMRMLTableModel;
35class vtkMRMLNode;
36class vtkMRMLScene;
39
42class QMRML_WIDGETS_EXPORT qMRMLTableView : public QTableView
43{
44 Q_OBJECT
45 Q_PROPERTY(bool transposed READ transposed WRITE setTransposed)
48public:
49 qMRMLTableView(QWidget* parent = nullptr);
50 ~qMRMLTableView() override;
51
53 Q_INVOKABLE vtkMRMLScene* mrmlScene() const;
54
57
58 Q_INVOKABLE vtkMRMLTableNode* mrmlTableNode() const;
59
60 Q_INVOKABLE qMRMLTableModel* tableModel() const;
61 Q_INVOKABLE QSortFilterProxyModel* sortFilterProxyModel() const;
62
63 bool transposed() const;
64 bool firstRowLocked() const;
65 bool firstColumnLocked() const;
66
68
69public slots:
73 void setMRMLScene(vtkMRMLScene* newScene);
74
77
80 void setMRMLTableNode(vtkMRMLNode* tableNode);
81
86
87 void setFirstRowLocked(bool locked);
88 void setFirstColumnLocked(bool locked);
89
93
94 void insertRow();
96
97 void deleteRow();
99
100signals:
101
106
109
110protected:
111 void keyPressEvent(QKeyEvent* event) override;
112
113 QScopedPointer<qMRMLTableViewPrivate> d_ptr;
114
115 void selectionChanged(const QItemSelection& selected, const QItemSelection& deselected) override;
116
117private:
118 Q_DECLARE_PRIVATE(qMRMLTableView);
119 Q_DISABLE_COPY(qMRMLTableView);
120};
121
122#endif
void setFirstRowLocked(bool locked)
void selectionChanged()
Emitted when a different table node is selected or different cells are selected.
qMRMLTableView(QWidget *parent=nullptr)
void copySelection()
Q_INVOKABLE vtkMRMLTableNode * mrmlTableNode() const
QList< int > selectedMRMLTableColumnIndices() const
Q_INVOKABLE qMRMLTableModel * tableModel() const
void mrmlSceneChanged(vtkMRMLScene *)
void pasteSelection()
void keyPressEvent(QKeyEvent *event) override
void plotSelection()
void insertColumn()
void setMRMLScene(vtkMRMLScene *newScene)
void deleteColumn()
Q_INVOKABLE vtkMRMLScene * mrmlScene() const
Return a pointer on the current MRML scene.
void setMRMLTableViewNode(vtkMRMLTableViewNode *newTableViewNode)
Set the current viewNode to observe. If nullptr then view properties are not stored in the scene.
void setMRMLTableNode(vtkMRMLTableNode *tableNode)
Q_INVOKABLE vtkMRMLTableViewNode * mrmlTableViewNode() const
Get the TableView node observed by view.
QScopedPointer< qMRMLTableViewPrivate > d_ptr
void setTransposed(bool transposed)
Q_INVOKABLE QSortFilterProxyModel * sortFilterProxyModel() const
void setFirstColumnLocked(bool locked)
Abstract Superclass for all specific types of MRML nodes.
A set of MRML Nodes that supports serialization and undo/redo.
MRML node to represent a table object.
MRML node to represent table view parameters.