×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Feb 2012
    Posts
    125

    Question 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
    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.

  2. #2
    Regular Contributor
    Join Date
    Feb 2012
    Posts
    125

    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.

  3. #3
    Regular Contributor
    Join Date
    Feb 2012
    Posts
    125

    Re: Getting change in x in a Flickable element

    I cross posted to try and get an answer: http://www.developer.nokia.com/Commu...kable-elements

  4. #4
    Registered User
    Join Date
    Sep 2011
    Posts
    449

    Re: Getting change in x in a Flickable element

    Updated about this in the other thread .

    Lets have the discussion there only.

Similar Threads

  1. Populating QML Object on QML Flickable Element
    By ronie.amata in forum [Archived] Qt Quick
    Replies: 2
    Last Post: 2012-05-08, 08:52
  2. QML Flickable Element performance
    By cadlg in forum [Archived] Qt Quick
    Replies: 1
    Last Post: 2011-03-18, 01:57
  3. change svg text element
    By mehdi_shz11 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2010-09-28, 06:30
  4. Howto: Change gradient of Polygon element programmatically
    By ieising in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2009-05-25, 16:22

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×