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;
static PyObject * pythonModule(const QString &module)
Given a string of the form "<modulename1>[.<modulenameN>...]" containing modules, return the final mo...
virtual ~ctkAbstractPythonManager()
void printStderr(const QString &)
virtual void preInitialization()
Overload this function to load Decorator and pythonQt wrapper at initialization time.
void setInitializationFlags(int flags)
static PyObject * pythonObject(const QString &variableNameAndFunction)
void registerCPPClassForPythonQt(const char *name)
Q_INVOKABLE void executeFile(const QString &filename)
Execute a python script with the given filename.
int initializationFlags() const
void setInitializationFunction(void(*initFunction)())
QVariant getVariable(const QString &varName)
void setSystemExitExceptionHandlerEnabled(bool value)
Q_INVOKABLE QVariant executeString(const QString &code, ExecuteStringMode mode=FileInput)
bool systemExitExceptionHandlerEnabled() const
static QStringList splitByDotOutsideParenthesis(const QString &pythonVariableName)
virtual QStringList pythonPaths()
void registerPythonQtDecorator(QObject *decorator)
void systemExitExceptionRaised(int exitCode)
virtual void executeInitializationScripts()
Overload this function to execute script at initialization time.
void pythonPreInitialized()
void addObjectToPythonMain(const QString &name, QObject *obj)
void addWrapperFactory(PythonQtForeignWrapperFactory *factory)
QStringList pythonAttributes(const QString &pythonVariableName, const QString &module=QLatin1String("__main__"), bool appendParenthesis=false) const
bool isPythonInitialized() const
void registerClassForPythonQt(const QMetaObject *metaobject)
static QStringList dir_object(PyObject *object, bool appendParenthesis=false)
QScopedPointer< ctkAbstractPythonManagerPrivate > d_ptr
ctkAbstractPythonManager(QObject *_parent=NULL)
bool pythonErrorOccured() const
void printStdout(const QString &)
PythonQtObjectPtr mainContext()
void initPythonQt(int flags)