×

Discussion Board

Results 1 to 3 of 3

Hybrid View

  1. #1
    Registered User
    Join Date
    Feb 2011
    Posts
    24

    ListView contentY problem

    Hi

    In my QML app I have a ListView populated from a model. Each delegate in the ListView is a button which moves you to a new screen. I save the ListView’s contentY property so that when the user moves back, he/she can be at the same point in the list as when he left it.

    The problem is that, if this point is some way down the list, there is a pause to move there, because the ListView instantiates each delegate until that point is reached.

    In a list with many delegates this causes a noticeable slow-down.

    I guess this happens because the system doesn’t know what height each delegate is, so it has to instantiate each one to figure out which delegate is at the given Y co-ordinate.

    Is there a way round this? e.g. to specify a fixed height for each delegate? Or to give delegates a way to return their height without instantiating themselves (Cocoa Touch’s ListView equivalent, I forget what it is called, offers both of these).

    Thanks

  2. #2
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: ListView contentY problem

    did you tried with the index property instead of contentY ?
    Also, you can switch view but keep the listview in the background (set opacity to 0), therefore having it stay at the current Y position

  3. #3
    Registered User
    Join Date
    Feb 2011
    Posts
    24

    Re: ListView contentY problem

    This problem was solved by positioning the ListView using the positionViewAtIndex method. The ListView snaps to the index instantly instead of rendering all previous list items.

Similar Threads

  1. QML ListView grows up
    By missdeer in forum [Archived] Qt Quick
    Replies: 6
    Last Post: 2011-11-23, 08:21
  2. ListView item removing problem
    By pippo2010 in forum [Archived] Qt Quick
    Replies: 0
    Last Post: 2011-02-25, 23:01
  3. Customize Listview in Qt
    By shank_19 in forum Qt
    Replies: 2
    Last Post: 2010-10-14, 03:08
  4. qt listview problems
    By kasperc in forum Nokia N9
    Replies: 2
    Last Post: 2010-04-28, 21:02
  5. WRTKit ListView issues...
    By sk272 in forum Symbian
    Replies: 0
    Last Post: 2009-11-02, 14:38

Posting Permissions

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