#include <PythonScript.h>
Public Slots |
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.
|
virtual QVariant | eval () |
| Evaluate the Code, returning QVariant() on an error / exception.
|
virtual bool | exec () |
| Execute the Code, returning false on an error / exception.
|
virtual bool | setDouble (double, const char *) |
virtual bool | setInt (int, const char *) |
virtual bool | setQObject (const QObject *, const char *) |
Constructor & Destructor Documentation
PythonScript::PythonScript |
( |
PythonScripting * |
env, |
|
|
const QString & |
code, |
|
|
QObject * |
context = 0 , |
|
|
const QString & |
name = "<input>" |
|
) |
| |
PythonScript::~PythonScript |
( |
| ) |
|
Member Function Documentation
void PythonScript::beginStdoutRedirect |
( |
| ) |
|
|
private |
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(), and exec().
void PythonScript::endStdoutRedirect |
( |
| ) |
|
|
private |
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.
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.
void PythonScript::setContext |
( |
QObject * |
context | ) |
|
|
slot |
bool PythonScript::setDouble |
( |
double |
val, |
|
|
const char * |
name |
|
) |
| |
|
slot |
bool PythonScript::setInt |
( |
int |
val, |
|
|
const char * |
name |
|
) |
| |
|
slot |
bool PythonScript::setQObject |
( |
QObject * |
val, |
|
|
const char * |
name |
|
) |
| |
|
slot |
void PythonScript::write |
( |
const QString & |
text | ) |
|
|
inline |
Member Data Documentation
bool PythonScript::hasOldGlobals |
|
private |
bool PythonScript::isFunction |
|
private |
The documentation for this class was generated from the following files: