 |
CTK
0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
|
Go to the documentation of this file.
21 #ifndef __ctkAbstractPythonManager_h
22 #define __ctkAbstractPythonManager_h
27 #include <QStringList>
31 #include <PythonQtPythonInclude.h>
34 #include "ctkScriptingPythonCoreExport.h"
36 class ctkAbstractPythonManagerPrivate;
37 class PythonQtForeignWrapperFactory;
38 class PythonQtObjectPtr;
111 bool appendParenthesis =
false);
124 const QString& module = QLatin1String(
"__main__"),
125 bool appendParenthesis =
false)
const;
180 QScopedPointer<ctkAbstractPythonManagerPrivate>
d_ptr;
virtual void executeInitializationScripts()
Overload this function to execute script at initialization time.
Q_INVOKABLE QVariant executeString(const QString &code, ExecuteStringMode mode=FileInput)
void setInitializationFlags(int flags)
bool isPythonInitialized() const
virtual void preInitialization()
Overload this function to load Decorator and pythonQt wrapper at initialization time.
void addWrapperFactory(PythonQtForeignWrapperFactory *factory)
bool pythonErrorOccured() const
void printStderr(const QString &)
void systemExitExceptionRaised(int exitCode)
void initPythonQt(int flags)
QScopedPointer< ctkAbstractPythonManagerPrivate > d_ptr
void setInitializationFunction(void(*initFunction)())
void addObjectToPythonMain(const QString &name, QObject *obj)
virtual ~ctkAbstractPythonManager()
void registerCPPClassForPythonQt(const char *name)
QVariant getVariable(const QString &varName)
void printStdout(const QString &)
virtual QStringList pythonPaths()
int initializationFlags() const
void registerPythonQtDecorator(QObject *decorator)
void setSystemExitExceptionHandlerEnabled(bool value)
void registerClassForPythonQt(const QMetaObject *metaobject)
QStringList pythonAttributes(const QString &pythonVariableName, const QString &module=QLatin1String("__main__"), bool appendParenthesis=false) const
ctkAbstractPythonManager(QObject *_parent=NULL)
PythonQtObjectPtr mainContext()
Q_INVOKABLE void executeFile(const QString &filename)
Execute a python script with the given filename.
static QStringList dir_object(PyObject *object, bool appendParenthesis=false)
static PyObject * pythonModule(const QString &module)
Given a string of the form "<modulename1>[.<modulenameN>...]" containing modules, return the final mo...
void pythonPreInitialized()
static QStringList splitByDotOutsideParenthesis(const QString &pythonVariableName)
bool systemExitExceptionHandlerEnabled() const
static PyObject * pythonObject(const QString &variableNameAndFunction)