QtiPlot
0.9.8.2
|
#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. 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 *) |
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() More... | |
const QString | code () const |
Return the code that will be executed when calling exec() or eval() More... | |
QObject * | context () const |
Return the context in which the code is to be executed. More... | |
bool | emitErrors () const |
Return whether errors / exceptions are to be emitted or silently ignored. More... | |
const QString | name () const |
Like QObject::name, but with unicode support. More... | |
Script (ScriptingEnv *env, const QString &code, QObject *context=0, const QString &name="<input>") | |
ScriptingEnv * | scriptingEnv () |
virtual void | setCode (const QString &code) |
Set the code that will be executed when calling exec() or eval() More... | |
virtual void | setContext (QObject *context) |
Set the context in which the code is to be executed. More... | |
void | setEmitErrors (bool yes) |
Set whether errors / exceptions are to be emitted or silently ignored. More... | |
void | setName (const QString &name) |
Like QObject::setName, but with unicode support. More... | |
~Script () | |
Private Member Functions | |
void | beginStdoutRedirect () |
void | endStdoutRedirect () |
PythonScripting * | env () |
Private Attributes | |
bool | hasOldGlobals |
bool | isFunction |
PyObject * | modGlobalDict |
PyObject * | modLocalDict |
PyObject * | PyCode |
PyObject * | stderrSave |
PyObject * | stdoutSave |
Additional Inherited Members | |
![]() | |
void | codeChanged () |
This is emitted whenever the code to be executed by exec() and eval() is changed. More... | |
void | error (const QString &message, const QString &scriptName, int lineNumber) |
signal an error condition / exception More... | |
void | print (const QString &output) |
output generated by the code More... | |
![]() | |
enum | compileStatus { notCompiled, isCompiled, compileErr } |
![]() | |
void | emit_error (const QString &message, int lineNumber) |
![]() | |
QString | Code |
enum Script::compileStatus | compiled |
QObject * | Context |
bool | EmitErrors |
ScriptingEnv * | Env |
QString | Name |
PythonScript::PythonScript | ( | PythonScripting * | env, |
const QString & | code, | ||
QObject * | context = 0 , |
||
const QString & | name = "<input>" |
||
) |
References Script::Context, env(), modGlobalDict, modLocalDict, PyCode, and setQObject().
PythonScript::~PythonScript | ( | ) |
References modGlobalDict, modLocalDict, and PyCode.
|
private |
References env(), PythonScripting::setQObject(), stderrSave, and stdoutSave.
|
slot |
|
private |
References env(), stderrSave, and stdoutSave.
|
inlineprivate |
References beginStdoutRedirect(), endStdoutRedirect(), and Script::Env.
Referenced by beginStdoutRedirect(), compile(), endStdoutRedirect(), eval(), exec(), PythonScript(), setDouble(), setInt(), and setQObject().
|
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().
|
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().
|
slot |
References Script::Context, Script::setContext(), and setQObject().
Referenced by write().
|
slot |
References Script::compiled, env(), modGlobalDict, modLocalDict, and Script::notCompiled.
Referenced by write().
|
slot |
References Script::compiled, env(), modGlobalDict, modLocalDict, and Script::notCompiled.
Referenced by write().
|
slot |
References Script::compiled, env(), modGlobalDict, modLocalDict, and Script::notCompiled.
Referenced by PythonScript(), setContext(), and write().
|
inline |
References compile(), Script::context(), eval(), exec(), Script::name(), Script::print(), setContext(), setDouble(), setInt(), and setQObject().
|
private |
Referenced by compile(), eval(), exec(), PythonScript(), setDouble(), setInt(), setQObject(), and ~PythonScript().
|
private |
Referenced by compile(), eval(), exec(), PythonScript(), setDouble(), setInt(), setQObject(), and ~PythonScript().
|
private |
Referenced by compile(), eval(), exec(), PythonScript(), and ~PythonScript().
|
private |
Referenced by beginStdoutRedirect(), and endStdoutRedirect().
|
private |
Referenced by beginStdoutRedirect(), and endStdoutRedirect().