- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends

# QScriptEngine Class Reference

Search for all occurrences

## Detailed Description

Definition at line 106 of file qscriptengine.h.

`#include <qscriptengine.h>`

Inheritance diagram for QScriptEngine:
[legend]

List of all members.

## Public Types
enum | ValueOwnership { QtOwnership, ScriptOwnership, AutoOwnership }
enum | QObjectWrapOption { ExcludeChildObjects = 0x0001, ExcludeSuperClassMethods = 0x0002, ExcludeSuperClassProperties = 0x0004, ExcludeSuperClassContents = 0x0006, SkipMethodsInEnumeration = 0x0008, ExcludeDeleteLater = 0x0010, ExcludeSlots = 0x0020, AutoCreateDynamicProperties = 0x0100, PreferExistingWrapperObject = 0x0200 }
typedef QScriptValue(* | FunctionSignature )(QScriptContext *, QScriptEngine *)
typedef QScriptValue(* | FunctionWithArgSignature )(QScriptContext *, QScriptEngine *, void *)
typedef QScriptValue(* | MarshalFunction )(QScriptEngine *, const void *)
typedef void(* | DemarshalFunction )(const QScriptValue &, void *)
## Signals
void | signalHandlerException (const QScriptValue &exception)
## Public Member Functions
| QScriptEngine ()
| QScriptEngine (QObject *parent)
virtual | ~QScriptEngine ()
QScriptValue | globalObject () const
void | setGlobalObject (const QScriptValue &object)
QScriptContext * | currentContext () const
QScriptContext * | pushContext ()
void | popContext ()
bool | canEvaluate (const QString &program) const
QScriptValue | evaluate (const QString &program, const QString &fileName=QString(), int lineNumber=1)
QScriptValue | evaluate (const QScriptProgram &program)
bool | isEvaluating () const
void | abortEvaluation (const QScriptValue &result=QScriptValue())
bool | hasUncaughtException () const
QScriptValue | uncaughtException () const
int | uncaughtExceptionLineNumber () const
QStringList | uncaughtExceptionBacktrace () const
void | clearExceptions ()
QScriptValue | nullValue ()
QScriptValue | undefinedValue ()
QScriptValue | newFunction (FunctionSignature signature, int length=0)
QScriptValue | newFunction (FunctionSignature signature, const QScriptValue &prototype, int length=0)
QScriptValue | newFunction (FunctionWithArgSignature signature, void *arg)
QScriptValue | newVariant (const QVariant &value)
QScriptValue | newVariant (const QScriptValue &object, const QVariant &value)
QScriptValue | newRegExp (const QRegExp &regexp)
QScriptValue | newObject ()
QScriptValue | newObject (QScriptClass *scriptClass, const QScriptValue &data=QScriptValue())
QScriptValue | newArray (uint length=0)
QScriptValue | newRegExp (const QString &pattern, const QString &flags)
QScriptValue | newDate (qsreal value)
QScriptValue | newDate (const QDateTime &value)
QScriptValue | newActivationObject ()
QScriptValue | newQObject (QObject *object, ValueOwnership ownership=QtOwnership, const QObjectWrapOptions &options=0)
QScriptValue | newQObject (const QScriptValue &scriptObject, QObject *qtObject, ValueOwnership ownership=QtOwnership, const QObjectWrapOptions &options=0)
QScriptValue | newQMetaObject (const QMetaObject *metaObject, const QScriptValue &ctor=QScriptValue())
template<class T >
QScriptValue | scriptValueFromQMetaObject ()
QScriptValue | defaultPrototype (int metaTypeId) const
void | setDefaultPrototype (int metaTypeId, const QScriptValue &prototype)
template<typename T >
QScriptValue | toScriptValue (const T &value)
template<typename T >
T | fromScriptValue (const QScriptValue &value)
void | installTranslatorFunctions (const QScriptValue &object=QScriptValue())
QScriptValue | importExtension (const QString &extension)
QStringList | availableExtensions () const
QStringList | importedExtensions () const
void | collectGarbage ()
void | reportAdditionalMemoryCost (int size)
void | setProcessEventsInterval (int interval)
int | processEventsInterval () const
void | setAgent (QScriptEngineAgent *agent)
QScriptEngineAgent * | agent () const
QScriptString | toStringHandle (const QString &str)
QScriptValue | toObject (const QScriptValue &value)
QScriptValue | objectById (qint64 id) const
## Static Public Member Functions
static QScriptSyntaxCheckResult | checkSyntax (const QString &program)
## Protected Member Functions
| QScriptEngine (QScriptEnginePrivate &dd, QObject *parent=0)
## Friends
void | qScriptRegisterMetaType_helper (QScriptEngine *, int, MarshalFunction, DemarshalFunction, const QScriptValue &)
QScriptValue | qScriptValueFromValue_helper (QScriptEngine *, int, const void *)
bool | qscriptvalue_cast_helper (const QScriptValue &, int, void *)

## Member Typedef Documentation

typedef QScriptValue(* FunctionSignature)(QScriptContext *, QScriptEngine *)

Search for all occurrences

Definition at line 167 of file qscriptengine.h.

typedef QScriptValue(* FunctionWithArgSignature)(QScriptContext *, QScriptEngine *, void *)

Search for all occurrences

Definition at line 168 of file qscriptengine.h.

typedef QScriptValue(* MarshalFunction)(QScriptEngine *, const void *)

Search for all occurrences

Definition at line 211 of file qscriptengine.h.

typedef void(* DemarshalFunction)(const QScriptValue &, void *)

Search for all occurrences

Definition at line 212 of file qscriptengine.h.

## Member Enumeration Documentation

enum ValueOwnership

Search for all occurrences

Enumerator:

  QtOwnership | Search for all occurrences
  ScriptOwnership | Search for all occurrences
  AutoOwnership | Search for all occurrences

Definition at line 115 of file qscriptengine.h.

                            {
            QtOwnership,
            ScriptOwnership,
            AutoOwnership
        };

enum QObjectWrapOption

Search for all occurrences

Enumerator:

  ExcludeChildObjects | Search for all occurrences
  ExcludeSuperClassMethods | Search for all occurrences
  ExcludeSuperClassProperties | Search for all occurrences
  ExcludeSuperClassContents | Search for all occurrences
  SkipMethodsInEnumeration | Search for all occurrences
  ExcludeDeleteLater | Search for all occurrences
  ExcludeSlots | Search for all occurrences
  AutoCreateDynamicProperties | Search for all occurrences
  PreferExistingWrapperObject | Search for all occurrences

Definition at line 121 of file qscriptengine.h.

                               {
            ExcludeChildObjects = 0x0001,
            ExcludeSuperClassMethods = 0x0002,
            ExcludeSuperClassProperties = 0x0004,
            ExcludeSuperClassContents = 0x0006,
            SkipMethodsInEnumeration = 0x0008,
            ExcludeDeleteLater = 0x0010,
            ExcludeSlots = 0x0020,

            AutoCreateDynamicProperties = 0x0100,
            PreferExistingWrapperObject = 0x0200
        };

## Constructor & Destructor Documentation

QScriptEngine | ( |  | ) |

QScriptEngine | ( | QObject * | parent | ) | `[explicit]`

virtual ~QScriptEngine | ( |  | ) | `[virtual]`

QScriptEngine | ( | QScriptEnginePrivate & | dd,
|  | QObject * | parent = `0`
| ) |  | `[protected]`

## Member Function Documentation

QScriptValue globalObject | ( |  | ) | const

Search for all occurrences

void setGlobalObject | ( | const QScriptValue & | object | ) |

Search for all occurrences

QScriptContext* currentContext | ( |  | ) | const

Search for all occurrences

QScriptContext* pushContext | ( |  | ) |

Search for all occurrences

void popContext | ( |  | ) |

Search for all occurrences

bool canEvaluate | ( | const QString & | program | ) | const

Search for all occurrences

static QScriptSyntaxCheckResult checkSyntax | ( | const QString & | program | ) | `[static]`

Search for all occurrences

QScriptValue evaluate | ( | const QString & | program,
|  | const QString & | fileName = `QString()`,
|  | int | lineNumber = `1`
| ) |  |

Search for all occurrences

QScriptValue evaluate | ( | const QScriptProgram & | program | ) |

Search for all occurrences

bool isEvaluating | ( |  | ) | const

Search for all occurrences

void abortEvaluation | ( | const QScriptValue & | result = `QScriptValue()` | ) |

Search for all occurrences

bool hasUncaughtException | ( |  | ) | const

Search for all occurrences

QScriptValue uncaughtException | ( |  | ) | const

Search for all occurrences

int uncaughtExceptionLineNumber | ( |  | ) | const

Search for all occurrences

QStringList uncaughtExceptionBacktrace | ( |  | ) | const

Search for all occurrences

void clearExceptions | ( |  | ) |

Search for all occurrences

QScriptValue nullValue | ( |  | ) |

Search for all occurrences

QScriptValue undefinedValue | ( |  | ) |

Search for all occurrences

QScriptValue newFunction | ( | FunctionSignature | signature,
|  | int | length = `0`
| ) |  |

Search for all occurrences

QScriptValue newFunction | ( | FunctionSignature | signature,
|  | const QScriptValue & | prototype,
|  | int | length = `0`
| ) |  |

Search for all occurrences

QScriptValue newFunction | ( | FunctionWithArgSignature | signature,
|  | void * | arg
| ) |  |

Search for all occurrences

QScriptValue newVariant | ( | const QVariant & | value | ) |

Search for all occurrences

QScriptValue newVariant | ( | const QScriptValue & | object,
|  | const QVariant & | value
| ) |  |

Search for all occurrences

QScriptValue newRegExp | ( | const QRegExp & | regexp | ) |

Search for all occurrences

QScriptValue newObject | ( |  | ) |

Search for all occurrences

QScriptValue newObject | ( | QScriptClass * | scriptClass,
|  | const QScriptValue & | data = `QScriptValue()`
| ) |  |

Search for all occurrences

QScriptValue newArray | ( | uint | length = `0` | ) |

Search for all occurrences

QScriptValue newRegExp | ( | const QString & | pattern,
|  | const QString & | flags
| ) |  |

Search for all occurrences

QScriptValue newDate | ( | qsreal | value | ) |

Search for all occurrences

QScriptValue newDate | ( | const QDateTime & | value | ) |

Search for all occurrences

QScriptValue newActivationObject | ( |  | ) |

Search for all occurrences

QScriptValue newQObject | ( | QObject * | object,
|  | ValueOwnership | ownership = `QtOwnership`,
|  | const QObjectWrapOptions & | options = `0`
| ) |  |

Search for all occurrences

QScriptValue newQObject | ( | const QScriptValue & | scriptObject,
|  | QObject * | qtObject,
|  | ValueOwnership | ownership = `QtOwnership`,
|  | const QObjectWrapOptions & | options = `0`
| ) |  |

Search for all occurrences

QScriptValue newQMetaObject | ( | const QMetaObject * | metaObject,
|  | const QScriptValue & | ctor = `QScriptValue()`
| ) |  |

Search for all occurrences

QScriptValue scriptValueFromQMetaObject | ( |  | ) |

Search for all occurrences

Definition at line 315 of file qscriptengine.h.

        {
            return qScriptValueFromQMetaObject<T>(this);
        }

QScriptValue defaultPrototype | ( | int | metaTypeId | ) | const

Search for all occurrences

void setDefaultPrototype | ( | int | metaTypeId,
|  | const QScriptValue & | prototype
| ) |  |

Search for all occurrences

QScriptValue toScriptValue | ( | const T & | value | ) | `[inline]`

Search for all occurrences

Definition at line 218 of file qscriptengine.h.

        {
            return qScriptValueFromValue(this, value);
        }

T fromScriptValue | ( | const QScriptValue & | value | ) | `[inline]`

Search for all occurrences

Definition at line 223 of file qscriptengine.h.

        {
            return qScriptValueToValue<T>(value);
        }

void installTranslatorFunctions | ( | const QScriptValue & | object = `QScriptValue()` | ) |

Search for all occurrences

QScriptValue importExtension | ( | const QString & | extension | ) |

Search for all occurrences

QStringList availableExtensions | ( |  | ) | const

Search for all occurrences

QStringList importedExtensions | ( |  | ) | const

Search for all occurrences

void collectGarbage | ( |  | ) |

Search for all occurrences

void reportAdditionalMemoryCost | ( | int | size | ) |

Search for all occurrences

void setProcessEventsInterval | ( | int | interval | ) |

Search for all occurrences

int processEventsInterval | ( |  | ) | const

Search for all occurrences

void setAgent | ( | QScriptEngineAgent * | agent | ) |

Search for all occurrences

QScriptEngineAgent* agent | ( |  | ) | const

Search for all occurrences

QScriptString toStringHandle | ( | const QString & | str | ) |

Search for all occurrences

QScriptValue toObject | ( | const QScriptValue & | value | ) |

Search for all occurrences

QScriptValue objectById | ( | qint64 | id | ) | const

Search for all occurrences

void signalHandlerException | ( | const QScriptValue & | exception | ) | `[signal]`

Search for all occurrences

## Friends And Related Function Documentation

void qScriptRegisterMetaType_helper | ( | QScriptEngine * | eng,
|  | int | type,
|  | QScriptEngine::MarshalFunction | mf,
|  | QScriptEngine::DemarshalFunction | df,
|  | const QScriptValue & | prototype
| ) |  | `[friend]`

Search for all occurrences

Definition at line 383 of file qscriptengine.h.

    {
        eng->registerCustomType(type, mf, df, prototype);
    }

QScriptValue qScriptValueFromValue_helper | ( | QScriptEngine * | engine,
|  | int | type,
|  | const void * | ptr
| ) |  | `[friend]`

Search for all occurrences

Definition at line 323 of file qscriptengine.h.

    {
        if (!engine)
            return QScriptValue();

        return engine->create(type, ptr);
    }

bool qscriptvalue_cast_helper | ( | const QScriptValue & | value,
|  | int | type,
|  | void * | ptr
| ) |  | `[friend]`

Search for all occurrences

Definition at line 346 of file qscriptengine.h.

    {
        return QScriptEngine::convertV2(value, type, ptr);
    }

The documentation for this class was generated from the following file:

- QtScript/qscriptengine.h

QScriptEngine QScriptEngine QScriptEngine QScriptEngine QScriptEngine QScriptEngine QScriptEngine QScriptEngine QScriptEngine QScriptEngine
QScriptEngine QScriptEngine QScriptEngine QScriptEngine QScriptEngine QScriptEngine QScriptEngine QScriptEngine QScriptEngine QScriptEngine