Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
qSlicerBaseQTCorePythonQtDecorators.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 __qSlicerBaseQTCorePythonQtDecorators_h
14#define __qSlicerBaseQTCorePythonQtDecorators_h
15
16// PythonQt includes
17#include <PythonQt.h>
18
19// Slicer includes
22#include "qSlicerUtils.h"
23
24#include "qSlicerBaseQTCoreExport.h"
25
26// NOTE:
27//
28// For decorators it is assumed that the methods will never be called
29// with the self argument as nullptr. The self argument is the first argument
30// for non-static methods.
31//
32
34{
35 Q_OBJECT
36public:
38 {
39 PythonQt::self()->registerClass(&qSlicerCoreApplication::staticMetaObject);
40 PythonQt::self()->registerClass(&qSlicerAbstractCoreModule::staticMetaObject);
41 PythonQt::self()->registerCPPClass("qSlicerUtils", nullptr, "qSlicerBaseQTCore");
42 // Note: Use registerCPPClassForPythonQt to register pure Cpp classes
43 }
44
45public slots:
46
47 //----------------------------------------------------------------------------
48 // qSlicerCoreApplication
49
50 //----------------------------------------------------------------------------
51 // static methods
52
53 //----------------------------------------------------------------------------
55
56 //----------------------------------------------------------------------------
57 // instance methods
58
59 //----------------------------------------------------------------------------
60 void sendEvent(qSlicerCoreApplication* app, QObject* _receiver, QEvent* _event) { app->sendEvent(_receiver, _event); }
61
62 //----------------------------------------------------------------------------
63 void processEvents(qSlicerCoreApplication* app) { app->processEvents(); }
64
65 //----------------------------------------------------------------------------
66 // qSlicerUtils
67
68 //----------------------------------------------------------------------------
69 // static methods
70
73 QString static_qSlicerUtils_replaceWikiUrlVersion(const QString& text, const QString& version) { return qSlicerUtils::replaceWikiUrlVersion(text, version); }
74
75 QString static_qSlicerUtils_replaceDocumentationUrlVersion(const QString& text, const QString& hostname, const QString& version)
76 {
77 return qSlicerUtils::replaceDocumentationUrlVersion(text, hostname, version);
78 }
79};
80
81//-----------------------------------------------------------------------------
83{
84 PythonQt::self()->addDecorators(new qSlicerBaseQTBasePythonQtDecorators);
85}
86
87#endif
QString static_qSlicerUtils_replaceDocumentationUrlVersion(const QString &text, const QString &hostname, const QString &version)
void sendEvent(qSlicerCoreApplication *app, QObject *_receiver, QEvent *_event)
QString static_qSlicerUtils_replaceWikiUrlVersion(const QString &text, const QString &version)
static bool testAttribute(qSlicerCoreApplication::ApplicationAttribute attribute)
static QString replaceDocumentationUrlVersion(const QString &text, const QString &hostname, const QString &version)
Return an updated text where Slicer documentation URL version is replaced with the provided one.
static QString replaceWikiUrlVersion(const QString &text, const QString &version)
Return an updated text where Slicer wiki URL version is replaced with the provided one....
void initqSlicerBaseQTCorePythonQtDecorators()