summaryrefslogtreecommitdiffstats
path: root/src/declarative/util/qdeclarativelistmodel.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-04-12 05:24:42 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-04-12 05:24:42 (GMT)
commitdaf297de1837d9462f172c213c5d49eca775491a (patch)
treeb07d9286323dae9ec952eb0d5fcada4650d2bb97 /src/declarative/util/qdeclarativelistmodel.cpp
parent4d7733adc414fa55b4b5596249197344806b8ab0 (diff)
parentb3854b33242b0ce38d194cebb2d3a86b85e0df4b (diff)
downloadQt-daf297de1837d9462f172c213c5d49eca775491a.zip
Qt-daf297de1837d9462f172c213c5d49eca775491a.tar.gz
Qt-daf297de1837d9462f172c213c5d49eca775491a.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'src/declarative/util/qdeclarativelistmodel.cpp')
-rw-r--r--src/declarative/util/qdeclarativelistmodel.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp
index 37bbb14..e3680f2 100644
--- a/src/declarative/util/qdeclarativelistmodel.cpp
+++ b/src/declarative/util/qdeclarativelistmodel.cpp
@@ -248,6 +248,20 @@ QDeclarativeListModelParser::ListInstruction *QDeclarativeListModelParser::ListM
*/
+/*
+ A ListModel internally uses either a NestedListModel or FlatListModel.
+
+ A NestedListModel can contain lists of ListElements (which
+ when retrieved from get() is accessible as a list model within the list
+ model) whereas a FlatListModel cannot.
+
+ ListModel uses a NestedListModel to begin with, and if the model is later
+ used from a WorkerScript, it changes to use a FlatListModel instead. This
+ is because ModelNode (which abstracts the nested list model data) needs
+ access to the declarative engine and script engine, which cannot be
+ safely used from outside of the main thread.
+*/
+
QDeclarativeListModel::QDeclarativeListModel(QObject *parent)
: QListModelInterface(parent), m_agent(0), m_nested(new NestedListModel(this)), m_flat(0), m_isWorkerCopy(false)
{
@@ -1351,6 +1365,7 @@ ModelObject::ModelObject()
void ModelObject::setValue(const QByteArray &name, const QVariant &val)
{
_mo->setValue(name, val);
+ setProperty(name.constData(), val);
}