1
Flickable{
Button{
onClicked: parent.?????????
}

Or do I have to create a function for this?

2
  • Does this help youtube.com/watch?v=7IrMJ5W3WL8?
    – TuKsn
    Aug 17, 2014 at 9:54
  • @TuKsn Nope; this does not tell me how to make a flickable scroll smoothly on a button press.
    – Anon
    Aug 18, 2014 at 6:04

1 Answer 1

2

You can make a Flickable scroll to a specific point by setting the contentY property of a Flickable. Quoting the official documentation from qt-project.org,

ContentY holds the surface coordinate currently at the top-left corner of the Flickable. For example, if you flick an image up 100 pixels, contentY will be 100.

So if you want to scroll a Flickable smoothly with the press of a button, you could animate the contentY property change like,

Behavior on contentY {
    UbuntuNumberAnimation {}
}

This will gradually change the value of contentY instead of setting it to its final value abruptly.

You can find more about the contentY property here.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .