Bläddra i källkod

ENH: ctkSimplePythonShell - Added simplePythonQtDecorator class draft

See DecoratorSlots - http://pythonqt.sourceforge.net/Developer.html
Jean-Christophe Fillion-Robin 15 år sedan
förälder
incheckning
387fe52152

+ 2 - 0
Applications/ctkSimplePythonShell/CMakeLists.txt

@@ -7,12 +7,14 @@ PROJECT(ctkSimplePythonShell)
 SET(KIT_SRCS
   ctkSimplePythonManager.cpp
   ctkSimplePythonManager.h
+  ctkSimplePythonQtDecorators.h
   ctkSimplePythonShellMain.cpp
 )
 
 # Headers that should run through moc
 SET(KIT_MOC_SRCS
   ctkSimplePythonManager.h
+  ctkSimplePythonQtDecorators.h
   )
 
 # UI files

+ 3 - 3
Applications/ctkSimplePythonShell/ctkSimplePythonManager.cpp

@@ -1,7 +1,7 @@
 
 // CTK includes
 #include "ctkSimplePythonManager.h"
-//#include "qSlicerBaseQTBasePythonQtDecorators.h"
+#include "ctkSimplePythonQtDecorators.h"
 
 //-----------------------------------------------------------------------------
 ctkSimplePythonManager::ctkSimplePythonManager(QObject* _parent) : Superclass(_parent)
@@ -28,8 +28,8 @@ void ctkSimplePythonManager::preInitialization()
   Superclass::preInitialization();
 
   // Register decorators
-  //this->registerPythonQtDecorator(new qSlicerBaseQTBasePythonQtDecorators(this));
-
+  this->registerPythonQtDecorator(new ctkSimplePythonQtDecorators(this));  
+  
   // Add object to python interpreter context
   //this->addObjectToPythonMain("_qSlicerCoreApplicationInstance", app);
 

+ 38 - 0
Applications/ctkSimplePythonShell/ctkSimplePythonQtDecorators.h

@@ -0,0 +1,38 @@
+
+#ifndef __ctkSimplePythonQtDecorators_h
+#define __ctkSimplePythonQtDecorators_h
+
+// CTK includes
+#include <ctkAbstractPythonManager.h>
+
+// NOTE:
+//
+// For decorators it is assumed that the methods will never be called
+// with the self argument as NULL.  The self argument is the first argument
+// for non-static methods.
+//
+
+class ctkSimplePythonQtDecorators : public QObject
+{
+  Q_OBJECT
+
+public:
+
+  ctkSimplePythonQtDecorators(ctkAbstractPythonManager* pythonManager)
+    {
+    Q_ASSERT(pythonManager);
+    //pythonManager->registerClassForPythonQt(&qSlicerCoreApplication::staticMetaObject);
+    //pythonManager->registerClassForPythonQt(&qSlicerModuleManager::staticMetaObject);
+    //pythonManager->registerClassForPythonQt(&qSlicerAbstractModule::staticMetaObject);
+    //pythonManager->registerClassForPythonQt(&qSlicerAbstractModuleWidget::staticMetaObject);
+    //pythonManager->registerCPPClassForPythonQt("qSlicerModuleFactoryManager");
+    }
+
+public slots:
+
+  
+  
+};
+
+#endif
+