21 #ifndef __ctkAbstractPythonManager_h 22 #define __ctkAbstractPythonManager_h 27 #include <QStringList> 30 #include "ctkScriptingPythonCoreExport.h" 32 class ctkAbstractPythonManagerPrivate;
33 class PythonQtForeignWrapperFactory;
34 class PythonQtObjectPtr;
50 void setInitializationFlags(
int flags);
53 int initializationFlags()
const;
63 PythonQtObjectPtr mainContext();
65 void addObjectToPythonMain(
const QString& name, QObject* obj);
66 void addWrapperFactory(PythonQtForeignWrapperFactory* factory);
67 void registerPythonQtDecorator(QObject* decorator);
68 void registerClassForPythonQt(
const QMetaObject* metaobject);
69 void registerCPPClassForPythonQt(
const char* name);
72 bool systemExitExceptionHandlerEnabled()
const;
75 void setSystemExitExceptionHandlerEnabled(
bool value);
94 QVariant getVariable(
const QString& varName);
97 void executeFile(
const QString& filename);
101 void setInitializationFunction(
void (*initFunction)());
107 QStringList pythonAttributes(
const QString& pythonVariableName,
108 const QString& module = QLatin1String(
"__main__"),
109 bool appendParenthesis =
false)
const;
113 bool isPythonInitialized()
const;
117 bool pythonErrorOccured()
const;
121 void resetErrorFlag();
128 void pythonPreInitialized();
133 void pythonInitialized();
138 void systemExitExceptionRaised(
int exitCode);
141 void printStderr(
const QString&);
142 void printStdout(
const QString&);
146 void initPythonQt(
int flags);
148 virtual QStringList pythonPaths();
151 virtual void preInitialization();
154 virtual void executeInitializationScripts();
157 QScopedPointer<ctkAbstractPythonManagerPrivate>
d_ptr;
QScopedPointer< ctkAbstractPythonManagerPrivate > d_ptr