aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativecomponent_p.h
diff options
context:
space:
mode:
authorChris Adams <christopher.adams@nokia.com>2011-08-17 17:46:54 +1000
committerQt by Nokia <qt-info@nokia.com>2011-08-31 10:11:56 +0200
commit16f60d8ab6cdddeff860c3e2179cf2189908fc3e (patch)
tree22d6cef562033d364eba96a13e709f5e7b30d7ed /src/declarative/qml/qdeclarativecomponent_p.h
parent8b38efd412c8b340a4c078b5f2012c0da26f17ac (diff)
Allow initial property values to be defined with QSGLoader
This commit adds an "active" property to QSGLoader, which can be used to delay instantiation of the item until the user wishes to activate the loader. The property is true by default in order to maintain compatibility with previous behaviour. The commit also adds a "setSource(v8object)" function to QSGLoader, which behaves identically to setSource() property mutator except that it takes a JavaScript object parameter which defines the initial property values of the item (in a manner similar to that of QDeclarativeComponent::createObject()). Task-number: QTBUG-17009 Change-Id: Ifd824b518b60ef7aa3017c384835abb552e65cf1 Reviewed-on: http://codereview.qt.nokia.com/3364 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'src/declarative/qml/qdeclarativecomponent_p.h')
-rw-r--r--src/declarative/qml/qdeclarativecomponent_p.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/declarative/qml/qdeclarativecomponent_p.h b/src/declarative/qml/qdeclarativecomponent_p.h
index 7677f305e2..ba937491b7 100644
--- a/src/declarative/qml/qdeclarativecomponent_p.h
+++ b/src/declarative/qml/qdeclarativecomponent_p.h
@@ -55,6 +55,7 @@
#include "qdeclarativecomponent.h"
+#include "private/qv8_p.h"
#include "private/qdeclarativeengine_p.h"
#include "private/qdeclarativetypeloader_p.h"
#include "private/qbitfield_p.h"
@@ -69,6 +70,8 @@
QT_BEGIN_NAMESPACE
+class QV8Engine;
+
class QDeclarativeComponent;
class QDeclarativeEngine;
class QDeclarativeCompiledData;
@@ -83,6 +86,8 @@ public:
QObject *beginCreate(QDeclarativeContextData *, const QBitField &);
void completeCreate();
+ QObject *createObjectWithInitialProperties(v8::Handle<v8::Object> qmlGlobal, v8::Handle<v8::Object> valuemap, QObject *parentObject);
+ QObject *completeCreateObjectWithInitialProperties(v8::Handle<v8::Object> qmlGlobal, v8::Handle<v8::Object> valuemap, QObject *toCreate);
QDeclarativeTypeData *typeData;
virtual void typeDataReady(QDeclarativeTypeData *);
@@ -115,6 +120,7 @@ public:
ConstructionState *state);
static void complete(QDeclarativeEnginePrivate *enginePriv, ConstructionState *state);
+
QDeclarativeEngine *engine;
QDeclarativeGuardedContextData creationContext;