#include <PythonScript.h>
|
bool | compile (bool for_eval=true) |
|
QVariant | eval () |
|
bool | exec () |
|
void | setContext (QObject *context) |
|
bool | setDouble (double val, const char *name) |
|
bool | setInt (int val, const char *name) |
|
bool | setQObject (QObject *val, const char *name) |
|
virtual bool | compile (bool for_eval=true) |
| Compile the Code. Return true if the implementation doesn't support compilation. More...
|
|
virtual QVariant | eval () |
| Evaluate the Code, returning QVariant() on an error / exception. More...
|
|
virtual bool | exec () |
| Execute the Code, returning false on an error / exception. More...
|
|
virtual bool | setDouble (double, const char *) |
|
virtual bool | setInt (int, const char *) |
|
virtual bool | setQObject (const QObject *, const char *) |
|
◆ PythonScript()
PythonScript::PythonScript |
( |
PythonScripting * |
env, |
|
|
const QString & |
code, |
|
|
QObject * |
context = 0 , |
|
|
const QString & |
name = "<input>" |
|
) |
| |
◆ ~PythonScript()
PythonScript::~PythonScript |
( |
| ) |
|
◆ beginStdoutRedirect()
void PythonScript::beginStdoutRedirect |
( |
| ) |
|
|
private |
◆ compile
bool PythonScript::compile |
( |
bool |
for_eval = true | ) |
|
|
slot |
References Script::Code, Script::compiled, Script::compileErr, Script::Context, Script::emit_error(), env(), hasOldGlobals, Script::isCompiled, modGlobalDict, modLocalDict, Script::Name, and PyCode.
Referenced by eval(), exec(), and write().
◆ endStdoutRedirect()
void PythonScript::endStdoutRedirect |
( |
| ) |
|
|
private |
◆ env()
References beginStdoutRedirect(), endStdoutRedirect(), and Script::Env.
Referenced by beginStdoutRedirect(), compile(), endStdoutRedirect(), eval(), exec(), PythonScript(), setDouble(), setInt(), and setQObject().
◆ eval
QVariant PythonScript::eval |
( |
| ) |
|
|
slot |
References beginStdoutRedirect(), compile(), Script::compiled, Script::emit_error(), endStdoutRedirect(), env(), PythonScripting::globalDict(), hasOldGlobals, Script::isCompiled, isFunction, modGlobalDict, modLocalDict, Script::notCompiled, and PyCode.
Referenced by write().
◆ exec
bool PythonScript::exec |
( |
| ) |
|
|
slot |
References beginStdoutRedirect(), compile(), Script::compiled, Script::emit_error(), endStdoutRedirect(), env(), PythonScripting::globalDict(), hasOldGlobals, Script::isCompiled, isFunction, modGlobalDict, modLocalDict, Script::notCompiled, and PyCode.
Referenced by write().
◆ setContext
void PythonScript::setContext |
( |
QObject * |
context | ) |
|
|
slot |
◆ setDouble
bool PythonScript::setDouble |
( |
double |
val, |
|
|
const char * |
name |
|
) |
| |
|
slot |
◆ setInt
bool PythonScript::setInt |
( |
int |
val, |
|
|
const char * |
name |
|
) |
| |
|
slot |
◆ setQObject
bool PythonScript::setQObject |
( |
QObject * |
val, |
|
|
const char * |
name |
|
) |
| |
|
slot |
◆ write()
void PythonScript::write |
( |
const QString & |
text | ) |
|
|
inline |
◆ hasOldGlobals
bool PythonScript::hasOldGlobals |
|
private |
◆ isFunction
bool PythonScript::isFunction |
|
private |
◆ modGlobalDict
◆ modLocalDict
◆ PyCode
◆ stderrSave
◆ stdoutSave
The documentation for this class was generated from the following files: