aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicklistview.cpp
diff options
context:
space:
mode:
authorAlan Alpert <aalpert@blackberry.com>2013-04-11 16:57:19 -0700
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-26 21:17:42 +0200
commit53e317468626284fe26877659dff551ce3bc0e55 (patch)
treebb129a2df33f3a283bcb7e6f33be6b00659b4467 /src/quick/items/qquicklistview.cpp
parent8563adb737cec5d440197ddbd514fe201c5f18ff (diff)
No longer apply pending changes when accessing ItemView properties
Applying changes in the getters can lead to binding loops, and is currently inconsistently applied. Removing the applyPendingChanges calls from remaining getters, and adding a forceLayout() function for cases where the immediate-apply behavior is needed. Task-number: QTBUG-30555 Parts-of-patch-by: Albert Astals Cid Change-Id: I64632601e02f2a53060296ab7739577a749d916f Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au> Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
Diffstat (limited to 'src/quick/items/qquicklistview.cpp')
-rw-r--r--src/quick/items/qquicklistview.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/quick/items/qquicklistview.cpp b/src/quick/items/qquicklistview.cpp
index 53dc715469..b99fba4e4c 100644
--- a/src/quick/items/qquicklistview.cpp
+++ b/src/quick/items/qquicklistview.cpp
@@ -3108,6 +3108,21 @@ void QQuickListViewPrivate::translateAndTransitionItemsAfter(int afterModelIndex
\b Note: methods should only be called after the Component has completed.
*/
+/*!
+ \qmlmethod QtQuick2::ListView::forceLayout()
+
+ Responding to changes in the model is usually batched to happen only once
+ per frame. This means that inside script blocks it is possible for the
+ underlying model to have changed, but the ListView has not caught up yet.
+
+ This method forces the ListView to immediately respond to any outstanding
+ changes in the model.
+
+ \since 5.1
+
+ \b Note: methods should only be called after the Component has completed.
+*/
+
QQuickListViewAttached *QQuickListView::qmlAttachedProperties(QObject *obj)
{
return new QQuickListViewAttached(obj);