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
qSlicerScriptedLoadableModuleWidget.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 Jean-Christophe Fillion-Robin, Kitware Inc.
17 and was partially funded by NIH grant 3P41RR013218-12S1
18
19==============================================================================*/
20
21#ifndef __qSlicerScriptedLoadableModuleWidget_h
22#define __qSlicerScriptedLoadableModuleWidget_h
23
24// Slicer includes
26
27#include "qSlicerBaseQTGUIExport.h"
28
29// Forward Declare PyObject*
30#ifndef PyObject_HEAD
31struct _object;
32typedef _object PyObject;
33#endif
34class qSlicerScriptedLoadableModuleWidgetPrivate;
35
36class Q_SLICER_BASE_QTGUI_EXPORT qSlicerScriptedLoadableModuleWidget
38{
39 Q_OBJECT
40 Q_PROPERTY(QString moduleName READ moduleName)
41public:
43 typedef qSlicerScriptedLoadableModuleWidgetPrivate Pimpl;
44 qSlicerScriptedLoadableModuleWidget(QWidget * parentWidget=nullptr);
46
47 QString pythonSource()const;
48 bool setPythonSource(const QString& filePath, const QString& className = QLatin1String(""));
49
50 Q_INVOKABLE void reload();
51
53 Q_INVOKABLE PyObject* self() const;
54
55 void enter() override;
56 void exit() override;
57
58 bool setEditedNode(vtkMRMLNode* node, QString role = QString(), QString context = QString()) override;
59 double nodeEditable(vtkMRMLNode* node) override;
60
61protected:
62 void setup() override;
63
64protected:
65 QScopedPointer<qSlicerScriptedLoadableModuleWidgetPrivate> d_ptr;
66
67private:
68 Q_DECLARE_PRIVATE(qSlicerScriptedLoadableModuleWidget);
70};
71
72#endif
qSlicerAbstractModuleWidget(QWidget *parent=nullptr)
double nodeEditable(vtkMRMLNode *node) override
bool setPythonSource(const QString &filePath, const QString &className=QLatin1String(""))
QScopedPointer< qSlicerScriptedLoadableModuleWidgetPrivate > d_ptr
qSlicerScriptedLoadableModuleWidget(QWidget *parentWidget=nullptr)
bool setEditedNode(vtkMRMLNode *node, QString role=QString(), QString context=QString()) override
Node editing.
qSlicerScriptedLoadableModuleWidgetPrivate Pimpl
Q_INVOKABLE PyObject * self() const
Convenience method allowing to retrieve the associated scripted instance.
Abstract Superclass for all specific types of MRML nodes.
_object PyObject