Skip to content
  • Bea Lam's avatar
    Insertions were calculating wrong insertion pos · 52c1d7a9
    Bea Lam authored
    
    
    After removes, and after each insertion, the view must adjust the
    visibleItems.first() position and call layoutVisibleItems() to ensure
    that the correct insertion position is calculated for insertions that
    follow.
    
    When applyInsertionChange() in GridView and ListView calculates the
    position for item insertion, it looks at the current positions of the
    items in visibleItems, so these positions must be updated prior to
    this calculation. Otherwise, insertions that follow a remove may not
    calculate this position correctly and will neglect to add some items,
    and multiple insertions may unnecessarily create items at positions that
    are not actually visible.
    
    resetFirstItemPosition() is changed to take a set position and it
    replaces resetItemPosition() since it can do the same thing.
    
    Task-number: QTBUG-23610 QTBUG-23609
    
    Change-Id: I8839ee7d15853301435e80c0dc563f93fc3605cf
    Reviewed-by: default avatarMartin Jones <martin.jones@nokia.com>
    52c1d7a9