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 { Connections {
target: internalLoader.item.handle target: internalLoader.item.handle
onYChanged: { onYChanged: updateFromHandleTimer.running = true
if (internalLoader.isVertical) { onXChanged: updateFromHandleTimer.running = true
range.position = internalLoader.item.handle.y
}
}
onXChanged: {
if (!internalLoader.isVertical) {
range.position = internalLoader.item.handle.x
}
}
} }
RangeModel { RangeModel {
id: range 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" source: interactive ? "private/ScrollBarDelegate.qml" : "private/ScrollDecoratorDelegate.qml"
} }
} }