×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    8

    Flickable dynamic contentHeight problem

    I can't figure out how to set Flickables contentHeight property if i'm filling it with dynamically created components (Repeater component inside Column component to be exact).

    Documentation mentions that setting contentHeight to childrenRect.height will calculate flickables height automatically based on it's children. But i can't get it working.

    Am i missing something important?

  2. #2
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: Flickable dynamic contentHeight problem

    Hi,
    You can update the contentHeight of the flickable element when you component is loaded

    Eg:

    Flickable {
    id: mFlickable
    width: 200; height: 200

    Image { id: image; source: "bigImage.png"
    Component.onCompleted: {mFlickable.contentWidth: image.width; mFlickable.contentHeight: image.height}
    }
    }


    Since you have a repeater you can use onItemAdded onItemRemoved slots to update flickable's contentHeight IF contentWidth: myRepeater.width doesn't work.

  3. #3
    Registered User
    Join Date
    Mar 2009
    Posts
    8

    Re: Flickable dynamic contentHeight problem

    Thanx gnuton. Updateting Flickables contentHeight manually in onCompleted and onItemAdded signals did the trick for me.

Similar Threads

  1. Flickable & PinchArea
    By chits in forum [Archived] Qt Quick
    Replies: 1
    Last Post: 2011-05-17, 17:53
  2. QML Flickable Element performance
    By cadlg in forum [Archived] Qt Quick
    Replies: 1
    Last Post: 2011-03-18, 01:57
  3. Flickable and MouseUp
    By alichino in forum [Archived] Qt Quick
    Replies: 3
    Last Post: 2011-03-13, 08:53

Posting Permissions

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