summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlengine.h
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2009-06-09 02:46:10 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2009-06-09 02:46:10 (GMT)
commitdb4addcf3408140bb34fa8884c7192c1d9667be8 (patch)
tree3895f60a7c24d05082120c68d8d8fcd4972b2aaf /src/declarative/qml/qmlengine.h
parent991b41aa407b5a8740e6899a3efdc724276dcb95 (diff)
downloadQt-db4addcf3408140bb34fa8884c7192c1d9667be8.zip
Qt-db4addcf3408140bb34fa8884c7192c1d9667be8.tar.gz
Qt-db4addcf3408140bb34fa8884c7192c1d9667be8.tar.bz2
Add dynamic object creation from Script.
Can now create, inside script, objects from qml snippets and files. These objects can then be manipulated from script. Deleting these items is still being looked into.
Diffstat (limited to 'src/declarative/qml/qmlengine.h')
-rw-r--r--src/declarative/qml/qmlengine.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/declarative/qml/qmlengine.h b/src/declarative/qml/qmlengine.h
index 9382389..ca66097 100644
--- a/src/declarative/qml/qmlengine.h
+++ b/src/declarative/qml/qmlengine.h
@@ -44,6 +44,7 @@
#include <QtCore/qobject.h>
#include <QtCore/qmap.h>
+#include <QtScript/qscriptvalue.h>
QT_BEGIN_HEADER
@@ -57,6 +58,7 @@ class QmlExpression;
class QmlContext;
class QUrl;
class QScriptEngine;
+class QScriptContext;
class QNetworkAccessManager;
class Q_DECLARATIVE_EXPORT QmlEngine : public QObject
{
@@ -85,6 +87,13 @@ public:
static QmlContext *contextForObject(const QObject *);
static void setContextForObject(QObject *, QmlContext *);
+
+ static QScriptValue qmlScriptObject(QObject*, QmlEngine*);
+
+ // Below two functions provide a way to dynamically create objects from JS
+ static QScriptValue createComponent(QScriptContext*, QScriptEngine*);
+ static QScriptValue createQMLObject(QScriptContext*, QScriptEngine*);
+
private:
// LK: move to the private class
QScriptEngine *scriptEngine();