diff options
Diffstat (limited to 'src/declarative/qml/qmlengine.cpp')
-rw-r--r-- | src/declarative/qml/qmlengine.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index c0692eb..864d07e 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -147,6 +147,7 @@ QmlEnginePrivate::QmlEnginePrivate(QmlEngine *e) qtObject.setProperty(QLatin1String("md5"),scriptEngine.newFunction(md5, 1)); qtObject.setProperty(QLatin1String("btoa"),scriptEngine.newFunction(btoa, 1)); qtObject.setProperty(QLatin1String("atob"),scriptEngine.newFunction(atob, 1)); + qtObject.setProperty(QLatin1String("quit"), scriptEngine.newFunction(QmlEnginePrivate::quit, 0)); //firebug/webkit compat QScriptValue consoleObject = scriptEngine.newObject(); @@ -868,6 +869,19 @@ QScriptValue QmlEnginePrivate::consoleLog(QScriptContext *ctxt, QScriptEngine *e return e->newVariant(QVariant(true)); } +void QmlEnginePrivate::sendQuit () +{ + Q_Q(QmlEngine); + emit q->quit (); +} + +QScriptValue QmlEnginePrivate::quit(QScriptContext *ctxt, QScriptEngine *e) +{ + QmlEnginePrivate *qe = get (e); + qe->sendQuit (); + return QScriptValue(); +} + QScriptValue QmlEnginePrivate::closestAngle(QScriptContext *ctxt, QScriptEngine *e) { if(ctxt->argumentCount() < 2) |