diff options
Diffstat (limited to 'src/controls/Private/ScrollViewHelper.qml')
-rw-r--r-- | src/controls/Private/ScrollViewHelper.qml | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/controls/Private/ScrollViewHelper.qml b/src/controls/Private/ScrollViewHelper.qml index 810de91d9..530501080 100644 --- a/src/controls/Private/ScrollViewHelper.qml +++ b/src/controls/Private/ScrollViewHelper.qml @@ -68,31 +68,29 @@ Item { anchors.fill: parent - property bool recursionGuard: false - - function doLayout() { - if (!recursionGuard) { - recursionGuard = true + Timer { + id: layoutTimer + interval: 0; + onTriggered: { blockUpdates = true; scrollHelper.contentWidth = flickableItem !== null ? flickableItem.contentWidth : 0 scrollHelper.contentHeight = flickableItem !== null ? flickableItem.contentHeight : 0 scrollHelper.availableWidth = viewport.width scrollHelper.availableHeight = viewport.height blockUpdates = false; - recursionGuard = false } } Connections { target: viewport - onWidthChanged: doLayout() - onHeightChanged: doLayout() + onWidthChanged: layoutTimer.running = true + onHeightChanged: layoutTimer.running = true } Connections { target: flickableItem - onContentWidthChanged: doLayout() - onContentHeightChanged: doLayout() + onContentWidthChanged: layoutTimer.running = true + onContentHeightChanged: layoutTimer.running = true onContentXChanged: { hscrollbar.flash() vscrollbar.flash() |