Getting change in x in a Flickable element
So I've been playing and got a nice little app going on Symbian. But one thing is baffling me.
I have a Page that contains a Flickable element and in that element I have an Image and I allow left to right flicking only flickableDirection : Flickable.HorizontalFlick
I use onFlickEnded: to set a text field to image1.x but it only ever returns the initial x location of the image, but I expect it to be the new x location of the image which is somewhere off of the screen after a flick is ended!
Here is the code:
[CODE]
Page {
id: mainPage
Flickable {
id: flickable1
x: 0
contentWidth: image1.width; //It's a wide image, much wider than the screen
onFlickEnded: debugging.text = image1.x
Image {
id: image1
fillMode: Image.PreserveAspectFit
source: "Slide.jpg"
sourceSize.width: 2000
x: 10
[/CODE]
Whenever the image is flicked onFlickEnded sets debugging.text to 10 (the initial x value for the image). How do I work out which portion of the image is on the screen? What value should I be looking for?
Thanks.
Re: Getting change in x in a Flickable element
Should I post this elsewhere? Also I left out the irrelevant lines of code like the y position etc, if that is relevant to someone then I'll post the whole section.
Re: Getting change in x in a Flickable element
I cross posted to try and get an answer: [url]http://www.developer.nokia.com/Community/Discussion/showthread.php?235667-Getting-X-from-flickable-elements[/url]
Re: Getting change in x in a Flickable element
Updated about this in the other [URL="http://www.developer.nokia.com/Community/Discussion/showthread.php?235667-Getting-X-from-flickable-elements&p=893907#post893907"]thread [/URL].
Lets have the discussion there only.