summaryrefslogtreecommitdiffstats
path: root/doc/src
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-01-29 01:57:33 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-01-29 01:57:33 (GMT)
commit7081c571a33480cb6bb3db7391c9570e4b4e4be1 (patch)
treeead46b981958f25d2d33cd98fa0884518d8e1ceb /doc/src
parent91a0da8d3674d832fde87c9c1bc5a4bdb959ac3d (diff)
downloadQt-7081c571a33480cb6bb3db7391c9570e4b4e4be1.zip
Qt-7081c571a33480cb6bb3db7391c9570e4b4e4be1.tar.gz
Qt-7081c571a33480cb6bb3db7391c9570e4b4e4be1.tar.bz2
Document possibility of -1 index in delegate.
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/declarative/qmlmodels.qdoc7
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/src/declarative/qmlmodels.qdoc b/doc/src/declarative/qmlmodels.qdoc
index 2dc24fe..322f225 100644
--- a/doc/src/declarative/qmlmodels.qdoc
+++ b/doc/src/declarative/qmlmodels.qdoc
@@ -58,6 +58,13 @@ property in the delegate, the roles are usually accessed unqualified.
A special \e index role containing the index of the item in the model
is also available.
+\e Note: the index role will be set to -1 if the item is removed from
+the model. If you bind to the index role, be sure that the logic
+accounts for the possibility of index being -1, i.e. that the item
+is no longer valid. Usually the item will shortly be destroyed, but
+it is possible to delay delegate destruction in some views via a delayRemove
+attached property.
+
Models that do not have named roles will have the data provided via
the \e modelData role. The \e modelData role is also provided for
Models that have only one role. In this case the \e modelData role