QtQuick Flickable kinetic movement
-
Hmm... I am thinking wrong (again)... I can't move with rectangle inside flickable element (what am I doing wrong?!)
@// Nothing really happens
Flickable
{
id: flickable
boundsBehavior: Flickable.DragAndOvershootBounds
flickDeceleration: 0.5
contentHeight: rect.height
contentWidth: rect.widthRectangle { id: rect width: 60 height: 60 color: "red" }
}
@Well I think, I am thinking wrong once again ... flickable is just working inside the area of flickable, but not outside??
-
Hi,
I'm not sure if I understand exactly what you are after, but adding a width and height to the Flickable, e.g.
@width: 400; height: 400@
should make it possible to flick the Rectangle. If you want to flick the Rectangle, and not have it snap back to its original position, you can use a larger contentWidth and contentHeight and play around with the positioning/hierarchy/etc, e.g.
@Flickable
{
id: flickable
width: 400; height: 400
boundsBehavior: Flickable.DragAndOvershootBounds
contentWidth: 740; contentHeight: 740Rectangle { id: rect width: 60 height: 60 x: 340; y: 340 color: "red" }
}@
Regards,
Michael -
The problem is I can't have Flickable through the whole scene because there are also other active objects...hmm... I just want to move that rectangle on scene, but not to affect other objects...
okay that flicking is working, but it means Flickable is just an area, where I can flick?...
-
[quote author="Peppy" date="1342210863"]okay that flicking is working, but it means Flickable is just an area, where I can flick?...[/quote]
Yes, that sounds correct.
You might be able to get something working using the Flickable in a non-traditional manner, for example overlaying the scene with a Flickable with the Flick dynamics you are looking for, and then binding the Rectangle's position based on contextX/contentY (rather than the Rectangle being a child of the Flickable).
Regards,
Michael