Slicer  5.3
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
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
31 struct _object;
32 typedef _object PyObject;
33 #endif
34 class qSlicerScriptedLoadableModuleWidgetPrivate;
35 
36 class Q_SLICER_BASE_QTGUI_EXPORT qSlicerScriptedLoadableModuleWidget
38 {
39  Q_OBJECT
40  Q_PROPERTY(QString moduleName READ moduleName)
41 public:
43  typedef qSlicerScriptedLoadableModuleWidgetPrivate Pimpl;
44  qSlicerScriptedLoadableModuleWidget(QWidget * parentWidget=nullptr);
46 
47  QString pythonSource()const;
48  bool setPythonSource(const QString& newPythonSource, const QString& className = QLatin1String(""));
49 
51  Q_INVOKABLE PyObject* self() const;
52 
53  void enter() override;
54  void exit() override;
55 
56  bool setEditedNode(vtkMRMLNode* node, QString role = QString(), QString context = QString()) override;
57  double nodeEditable(vtkMRMLNode* node) override;
58 
59 protected:
60  void setup() override;
61 
62 protected:
63  QScopedPointer<qSlicerScriptedLoadableModuleWidgetPrivate> d_ptr;
64 
65 private:
66  Q_DECLARE_PRIVATE(qSlicerScriptedLoadableModuleWidget);
68 };
69 
70 #endif
Q_INVOKABLE bool setEditedNode(vtkMRMLNode *node, QString role=QString(), QString context=QString()) override
Node editing.
QScopedPointer< qSlicerScriptedLoadableModuleWidgetPrivate > d_ptr
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
Q_INVOKABLE double nodeEditable(vtkMRMLNode *node) override
qSlicerScriptedLoadableModuleWidgetPrivate Pimpl
_object PyObject
virtual Q_INVOKABLE void enter()
virtual Q_INVOKABLE void exit()