forceLayout before calling positionViewAtIndex
We need the list size to be correctly updated before positionViewAtIndex
This needs https://bugs.launchpad.net/ubuntu/+source/qtdeclarative-opensource-src/+bug/1556842 to actually work Fixes: #1553475
Approved by: Michael Zanetti
commite804c19b71a053c43c26fcd0732878a30b9607ed
authorAlbert Astals Cid <albert.astals@canonical.com>
dateWed 27 Apr 2016, 14:58 (10 years ago)
parentbcfc279c9fdb25
qml/Dash/Previews/Preview.qml+4−1
@@ -105,7 +105,10 @@ Item {
105105
106106 onFocusChanged: if (focus) column.positionViewAtIndex(index, ListView.Contain)
107107
108− onHeightChanged: if (focus) column.positionViewAtIndex(index, ListView.Contain)
108+ onHeightChanged: if (focus) {
109+ column.forceLayout();
110+ column.positionViewAtIndex(index, ListView.Contain)
111+ }
109112 }
110113 }
111114 }