Allow initial property values to be defined with QSGLoader
authorChris Adams <christopher.adams@nokia.com>
Wed, 17 Aug 2011 07:46:54 +0000 (17:46 +1000)
committerQt by Nokia <qt-info@nokia.com>
Wed, 31 Aug 2011 08:11:56 +0000 (10:11 +0200)
commit16f60d8ab6cdddeff860c3e2179cf2189908fc3e
tree22d6cef562033d364eba96a13e709f5e7b30d7ed
parent8b38efd412c8b340a4c078b5f2012c0da26f17ac
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>
27 files changed:
src/declarative/items/qsgloader.cpp
src/declarative/items/qsgloader_p.h
src/declarative/items/qsgloader_p_p.h
src/declarative/qml/qdeclarativecomponent.cpp
src/declarative/qml/qdeclarativecomponent_p.h
tests/auto/declarative/qsgloader/data/ActiveComponent.qml [new file with mode: 0644]
tests/auto/declarative/qsgloader/data/InitialPropertyValuesComponent.qml [new file with mode: 0644]
tests/auto/declarative/qsgloader/data/InvalidSourceComponent.qml [new file with mode: 0644]
tests/auto/declarative/qsgloader/data/active.1.qml [new file with mode: 0644]
tests/auto/declarative/qsgloader/data/active.2.qml [new file with mode: 0644]
tests/auto/declarative/qsgloader/data/active.3.qml [new file with mode: 0644]
tests/auto/declarative/qsgloader/data/active.4.qml [new file with mode: 0644]
tests/auto/declarative/qsgloader/data/active.5.qml [new file with mode: 0644]
tests/auto/declarative/qsgloader/data/active.6.qml [new file with mode: 0644]
tests/auto/declarative/qsgloader/data/initialPropertyValues.1.qml [new file with mode: 0644]
tests/auto/declarative/qsgloader/data/initialPropertyValues.2.qml [new file with mode: 0644]
tests/auto/declarative/qsgloader/data/initialPropertyValues.3.qml [new file with mode: 0644]
tests/auto/declarative/qsgloader/data/initialPropertyValues.4.qml [new file with mode: 0644]
tests/auto/declarative/qsgloader/data/initialPropertyValues.5.qml [new file with mode: 0644]
tests/auto/declarative/qsgloader/data/initialPropertyValues.6.qml [new file with mode: 0644]
tests/auto/declarative/qsgloader/data/initialPropertyValues.7.qml [new file with mode: 0644]
tests/auto/declarative/qsgloader/data/initialPropertyValues.binding.qml [new file with mode: 0644]
tests/auto/declarative/qsgloader/data/initialPropertyValues.error.1.qml [new file with mode: 0644]
tests/auto/declarative/qsgloader/data/initialPropertyValues.error.2.qml [new file with mode: 0644]
tests/auto/declarative/qsgloader/data/initialPropertyValues.error.3.qml [new file with mode: 0644]
tests/auto/declarative/qsgloader/data/initialPropertyValues.error.4.qml [new file with mode: 0644]
tests/auto/declarative/qsgloader/tst_qsgloader.cpp