summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2011-02-04 00:36:38 (GMT)
committerBea Lam <bea.lam@nokia.com>2011-02-04 04:29:02 (GMT)
commita9f1eaa6a368bf7a72b52c428728a3e3e0a76209 (patch)
tree11bc94638010740de4b3f4a7a7f4fc0d25a331b6 /src
parent80d0fe9cbd92288a08d5ced8767f1edb651dae37 (diff)
downloadQt-a9f1eaa6a368bf7a72b52c428728a3e3e0a76209.zip
Qt-a9f1eaa6a368bf7a72b52c428728a3e3e0a76209.tar.gz
Qt-a9f1eaa6a368bf7a72b52c428728a3e3e0a76209.tar.bz2
modelChanged() should not be emitted until view is repopulated
Otherwise, itemAt() returns invalid values at the time that modelChanged() is emitted. Task-number: QTBUG-17156 Reviewed-by: Martin Jones
Diffstat (limited to 'src')
-rw-r--r--src/declarative/graphicsitems/qdeclarativerepeater.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativerepeater.cpp b/src/declarative/graphicsitems/qdeclarativerepeater.cpp
index 8455513..4d0f34c 100644
--- a/src/declarative/graphicsitems/qdeclarativerepeater.cpp
+++ b/src/declarative/graphicsitems/qdeclarativerepeater.cpp
@@ -198,7 +198,6 @@ void QDeclarativeRepeater::setModel(const QVariant &model)
*/
}
d->dataSource = model;
- emit modelChanged();
QObject *object = qvariant_cast<QObject*>(model);
QDeclarativeVisualModel *vim = 0;
if (object && (vim = qobject_cast<QDeclarativeVisualModel *>(object))) {
@@ -226,6 +225,7 @@ void QDeclarativeRepeater::setModel(const QVariant &model)
*/
regenerate();
}
+ emit modelChanged();
emit countChanged();
}