Slicer  4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
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 // SlicerQt includes
20 #include "qSlicerCoreApplication.h"
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 NULL. The self argument is the first argument
30 // for non-static methods.
31 //
32 
34 {
35  Q_OBJECT
36 public:
37 
39  {
40  PythonQt::self()->registerClass(&qSlicerCoreApplication::staticMetaObject);
41  PythonQt::self()->registerClass(&qSlicerAbstractCoreModule::staticMetaObject);
42  PythonQt::self()->registerCPPClass("qSlicerUtils", 0, "qSlicerBaseQTCore");
43  // Note: Use registerCPPClassForPythonQt to register pure Cpp classes
44  }
45 
46 public slots:
47 
48  //----------------------------------------------------------------------------
49  // qSlicerCoreApplication
50 
51  //----------------------------------------------------------------------------
52  // static methods
53 
54  //----------------------------------------------------------------------------
56  {
58  }
59 
60  //----------------------------------------------------------------------------
61  // instance methods
62 
63  //----------------------------------------------------------------------------
64  void sendEvent(qSlicerCoreApplication* app, QObject* _receiver, QEvent* _event)
65  {
66  app->sendEvent(_receiver, _event);
67  }
68 
69  //----------------------------------------------------------------------------
71  {
72  app->processEvents();
73  }
74 
75  //----------------------------------------------------------------------------
76  // qSlicerUtils
77 
78  //----------------------------------------------------------------------------
79  // static methods
80 
81  QString static_qSlicerUtils_replaceWikiUrlVersion(const QString& text,
82  const QString& version)
83  {
84  return qSlicerUtils::replaceWikiUrlVersion(text, version);
85  }
86 };
87 
88 //-----------------------------------------------------------------------------
90 {
91  PythonQt::self()->addDecorators(new qSlicerBaseQTBasePythonQtDecorators);
92 }
93 
94 #endif
QString static_qSlicerUtils_replaceWikiUrlVersion(const QString &text, const QString &version)
static bool testAttribute(qSlicerCoreApplication::ApplicationAttribute attribute)
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 sendEvent(qSlicerCoreApplication *app, QObject *_receiver, QEvent *_event)
void initqSlicerBaseQTCorePythonQtDecorators()