Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
qSlicerBaseQTGUIPythonQtDecorators.h
Go to the documentation of this file.
1/*=auto=========================================================================
2
3 Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH)
4 All Rights Reserved.
5
6 See COPYRIGHT.txt
7 or http://www.slicer.org/copyright/copyright.txt for details.
8
9 Program: 3D Slicer
10
11=========================================================================auto=*/
12
13#ifndef __qSlicerBaseQTGUIPythonQtDecorators_h
14#define __qSlicerBaseQTGUIPythonQtDecorators_h
15
16// PythonQt includes
17#include <PythonQt.h>
18
19// CTK includes
20#include <ctkErrorLogModel.h>
21
22#include "vtkSlicerConfigure.h" // For Slicer_USE_QtTesting
23
24// CTK includes
25#ifdef Slicer_USE_QtTesting
26# include <ctkQtTestingUtility.h>
27#endif
28
29// Slicer includes
35
36#include "qSlicerBaseQTGUIExport.h"
37
38// NOTE:
39//
40// For decorators it is assumed that the methods will never be called
41// with the self argument as nullptr. The self argument is the first argument
42// for non-static methods.
43//
44
46{
47 Q_OBJECT
48
49public:
51 {
52 PythonQt::self()->registerClass(&qSlicerAbstractModuleWidget::staticMetaObject);
53 PythonQt::self()->registerClass(&qSlicerPythonManager::staticMetaObject);
54 PythonQt::self()->registerClass(&qSlicerCommandOptions::staticMetaObject);
55#ifdef Slicer_USE_QtTesting
56 PythonQt::self()->registerClass(&ctkQtTestingUtility::staticMetaObject);
57#endif
58 PythonQt::self()->registerClass(&ctkErrorLogModel::staticMetaObject);
59 PythonQt::self()->registerClass(&ctkErrorLogTerminalOutput::staticMetaObject);
60 // Note: Use registerCPPClassForPythonQt to register pure Cpp classes
61 }
62
63public slots:
64
65 //----------------------------------------------------------------------------
66 // qSlicerAbstractModule
67
68 //----------------------------------------------------------------------------
70
71 //----------------------------------------------------------------------------
76
77 //----------------------------------------------------------------------------
78 // qSlicerAbstractModule
79
80 //----------------------------------------------------------------------------
81 qSlicerAbstractModule* module(qSlicerAbstractModuleWidget* _moduleWidget) { return dynamic_cast<qSlicerAbstractModule*>(_moduleWidget->module()); }
82};
83
84//-----------------------------------------------------------------------------
86{
87 PythonQt::self()->addDecorators(new qSlicerBaseQTGUIPythonQtDecorators);
88}
89
90#endif
qSlicerAbstractModuleRepresentation * createNewWidgetRepresentation()
qSlicerAbstractModuleRepresentation * widgetRepresentation()
qSlicerAbstractCoreModule * module() const
qSlicerAbstractModuleWidget * createNewWidgetRepresentation(qSlicerAbstractModule *_module)
qSlicerAbstractModule * module(qSlicerAbstractModuleWidget *_moduleWidget)
qSlicerAbstractModuleWidget * widgetRepresentation(qSlicerAbstractModule *_module)
void initqSlicerBaseQTGUIPythonQtDecorators()