delay update from handle

we must wait the handle updated its size too for being able to correctly update range position from handle position
This commit is contained in:
Marco Martin 2012-08-01 11:16:47 +02:00
parent 8cdf691438
commit 6dd904d239

View File

@ -156,16 +156,8 @@ Item {
}
Connections {
target: internalLoader.item.handle
onYChanged: {
if (internalLoader.isVertical) {
range.position = internalLoader.item.handle.y
}
}
onXChanged: {
if (!internalLoader.isVertical) {
range.position = internalLoader.item.handle.x
}
}
onYChanged: updateFromHandleTimer.running = true
onXChanged: updateFromHandleTimer.running = true
}
RangeModel {
id: range
@ -219,6 +211,18 @@ Item {
}
}
Timer {
id: updateFromHandleTimer
interval: 10
onTriggered: {
if (internalLoader.isVertical) {
range.position = internalLoader.item.handle.y
} else {
range.position = internalLoader.item.handle.x
}
}
}
source: interactive ? "private/ScrollBarDelegate.qml" : "private/ScrollDecoratorDelegate.qml"
}
}