summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2010-04-12 04:40:52 (GMT)
committerBea Lam <bea.lam@nokia.com>2010-04-12 04:40:52 (GMT)
commit20a00436174faf746be14f5c36908710eeb44101 (patch)
tree4a3cbff247bf6ff9a4eb23f524d0c080c7d7f00c /src/declarative
parent0eb289bada4edb57de83d690c904a9c77c23caa2 (diff)
downloadQt-20a00436174faf746be14f5c36908710eeb44101.zip
Qt-20a00436174faf746be14f5c36908710eeb44101.tar.gz
Qt-20a00436174faf746be14f5c36908710eeb44101.tar.bz2
Doc fixes
Diffstat (limited to 'src/declarative')
-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);
}