summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlcomponent.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/qmlcomponent.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/qmlcomponent.h')
-rw-r--r--src/declarative/qml/qmlcomponent.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/declarative/qml/qmlcomponent.h b/src/declarative/qml/qmlcomponent.h
index e7386d9..bb76c8b 100644
--- a/src/declarative/qml/qmlcomponent.h
+++ b/src/declarative/qml/qmlcomponent.h
@@ -44,6 +44,7 @@
#include <QtCore/qobject.h>
#include <QtCore/qstring.h>
+#include <QtScript/qscriptvalue.h>
#include <QtDeclarative/qfxglobal.h>
#include <QtDeclarative/qml.h>
#include <QtDeclarative/qmlerror.h>
@@ -70,18 +71,20 @@ public:
const QUrl &baseUrl=QUrl(), QObject *parent=0);
virtual ~QmlComponent();
+ Q_ENUMS( Status );
enum Status { Null, Ready, Loading, Error };
Status status() const;
- bool isNull() const;
- bool isReady() const;
- bool isError() const;
- bool isLoading() const;
+ Q_INVOKABLE bool isNull() const;
+ Q_INVOKABLE bool isReady() const;
+ Q_INVOKABLE bool isError() const;
+ Q_INVOKABLE bool isLoading() const;
QList<QmlError> errors() const;
QUrl url() const;
+ Q_INVOKABLE QScriptValue createObject();
virtual QObject *create(QmlContext *context = 0);
virtual QObject *beginCreate(QmlContext *);
virtual void completeCreate();