-
Notifications
You must be signed in to change notification settings - Fork 514
/
qMRMLTableWidget.h
90 lines (69 loc) · 2.74 KB
/
qMRMLTableWidget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*==============================================================================
Program: 3D Slicer
Portions (c) Copyright 2015 Brigham and Women's Hospital (BWH) All Rights Reserved.
See COPYRIGHT.txt
or http://www.slicer.org/copyright/copyright.txt for details.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
This file was originally developed by Andras Lasso (PerkLab, Queen's
University) and Kevin Wang (Princess Margaret Hospital, Toronto) and was
supported through OCAIRO and the Applied Cancer Research Unit program of
Cancer Care Ontario.
==============================================================================*/
#ifndef __qMRMLTableWidget_h
#define __qMRMLTableWidget_h
// Qt includes
#include <QWidget>
class QResizeEvent;
// qMRMLWidget includes
#include "qMRMLWidget.h"
class qMRMLTableViewControllerWidget;
class qMRMLTableView;
class qMRMLTableWidgetPrivate;
// MRML includes
class vtkMRMLTableViewNode;
class vtkMRMLScene;
/// \brief qMRMLTableWidget is the toplevel table widget that can be
/// packed in a layout.
///
/// qMRMLTableWidget provides tabling capabilities with a display
/// canvas for the table and a controller widget to control the
/// content and properties of the table.
class QMRML_WIDGETS_EXPORT qMRMLTableWidget : public qMRMLWidget
{
Q_OBJECT
public:
/// Superclass typedef
typedef qMRMLWidget Superclass;
/// Constructors
explicit qMRMLTableWidget(QWidget* parent = nullptr);
~qMRMLTableWidget() override;
/// Get the table node observed by view.
Q_INVOKABLE vtkMRMLTableViewNode* mrmlTableViewNode()const;
/// Get a reference to the underlying Table View
/// Becareful if you change the TableView, you might
/// unsynchronize the view from the nodes/logics.
Q_INVOKABLE qMRMLTableView* tableView()const;
/// Get table view controller widget
Q_INVOKABLE qMRMLTableViewControllerWidget* tableController()const;
/// Get the view label for the table.
/// \sa qMRMLTableControllerWidget::tableViewLabel()
/// \sa setTableViewLabel()
QString viewLabel()const;
/// Set the view label for the table.
/// \sa qMRMLTableControllerWidget::tableViewLabel()
/// \sa tableViewLabel()
void setViewLabel(const QString& newTableViewLabel);
public slots:
/// Set the current \a viewNode to observe
void setMRMLTableViewNode(vtkMRMLTableViewNode* newTableViewNode);
protected:
QScopedPointer<qMRMLTableWidgetPrivate> d_ptr;
private:
Q_DECLARE_PRIVATE(qMRMLTableWidget);
Q_DISABLE_COPY(qMRMLTableWidget);
};
#endif