Details
-
Bug
-
Resolution: Out of scope
-
P2: Important
-
None
-
5.6.1, 5.7.0, 5.9.0
-
Windows, MacOS
Description
When opening a TableView (by modifying visible flag) that contains enough items to have scrolling enabled, scrolling the list down and up breaks the view when TableView is shown next time. After opening the TableView second time (with visible flag and repopulating the view), the view part ends up being scrolled by 1-2 items down, whereas the scrollbar is correctly scrolled to position 0. User has to scroll the scrollbar down by at least one pixel (or click) for the view to adjust the scrolling position correctly again.
Calling tableView.positionViewAtRow(0, ListView.Beginning); after repopulating the list fixes the view scrolling problem, but as a tradeof it (naturally) breaks the previous remembered scroll position.
One thing to note is that the model is repopulated each time the TableView is shown.
Steps to reproduce:
- Run attached sample
- Press "Show dialog" button
- Scroll list down and up, so that it ends up at scroll position 0
- Press "Ok"
- Press "Show dialog" button again
- EXPECTED: Scroll position is remembered for both view and scrollbar
- ACTUAL: Scrollbar is properly at position 0, but the scroll view shows half of the second item, and so is scrolled down 1-2 items
EDIT (2017/6/27): The scrollbar's behavior can be reproduced even without repopulating the model. See 'qtbug54122_sample2'.
How to observe:
- run sample2 attached
- move the scroll bar
- set the scroll bar position either to the very top or to the very bottom
- press 'Change Visibility' button (alternate between hide and show)
- observe the console.log output and notice how the scroll bar position changes. At the top position this causes the scroll bar to move as pointed out in the original sample.