#include <PythonScript.h>
List of all members.
Public Slots |
bool | compile (bool for_eval=true) |
| Compile the Code. Return true if the implementation doesn't support compilation.
|
QVariant | eval () |
| Evaluate the Code, returning QVariant() on an error / exception.
|
bool | exec () |
| Execute the Code, returning false on an error / exception.
|
void | setContext (QObject *context) |
| Set the context in which the code is to be executed.
|
bool | setDouble (double val, const char *name) |
bool | setInt (int val, const char *name) |
bool | setQObject (QObject *val, const char *name) |
virtual bool | setQObject (const QObject *, const char *) |
Public Member Functions |
| PythonScript (PythonScripting *env, const QString &code, QObject *context=0, const QString &name="<input>") |
void | write (const QString &text) |
| ~PythonScript () |
virtual void | addCode (const QString &code) |
| Append to the code that will be executed when calling exec() or eval()
|
const QString | code () const |
| Return the code that will be executed when calling exec() or eval()
|
const QObject * | context () const |
| Return the context in which the code is to be executed.
|
bool | emitErrors () const |
| Return whether errors / exceptions are to be emitted or silently ignored.
|
const QString | name () const |
| Like QObject::name, but with unicode support.
|
| Script (ScriptingEnv *env, const QString &code, QObject *context=0, const QString &name="<input>") |
virtual void | setCode (const QString &code) |
| Set the code that will be executed when calling exec() or eval()
|
void | setEmitErrors (bool yes) |
| Set whether errors / exceptions are to be emitted or silently ignored.
|
void | setName (const QString &name) |
| Like QObject::setName, but with unicode support.
|
| ~Script () |
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 | ) |
|
|
virtualslot |
Compile the Code. Return true if the implementation doesn't support compilation.
Reimplemented from Script.
References Script::Code, Script::compiled, Script::compileErr, Script::Context, Script::emit_error(), env(), Script::isCompiled, localDict, Script::Name, and PyCode.
Referenced by eval(), and exec().
void PythonScript::endStdoutRedirect |
( |
| ) |
|
|
private |
QVariant PythonScript::eval |
( |
| ) |
|
|
virtualslot |
Evaluate the Code, returning QVariant() on an error / exception.
Reimplemented from Script.
References beginStdoutRedirect(), compile(), Script::compiled, Script::emit_error(), endStdoutRedirect(), env(), Script::isCompiled, isFunction, localDict, Script::notCompiled, and PyCode.
bool PythonScript::exec |
( |
| ) |
|
|
virtualslot |
Execute the Code, returning false on an error / exception.
Reimplemented from Script.
References beginStdoutRedirect(), compile(), Script::compiled, Script::emit_error(), endStdoutRedirect(), env(), Script::isCompiled, isFunction, localDict, Script::notCompiled, and PyCode.
void PythonScript::setContext |
( |
QObject * |
context | ) |
|
|
virtualslot |
bool PythonScript::setDouble |
( |
double |
val, |
|
|
const char * |
name |
|
) |
| |
|
virtualslot |
bool PythonScript::setInt |
( |
int |
val, |
|
|
const char * |
name |
|
) |
| |
|
virtualslot |
bool PythonScript::setQObject |
( |
QObject * |
val, |
|
|
const char * |
name |
|
) |
| |
|
slot |
void PythonScript::write |
( |
const QString & |
text | ) |
|
|
inline |
Member Data Documentation
bool PythonScript::isFunction |
|
private |
The documentation for this class was generated from the following files: