View Full Version : How to sincronize the cell of my customt able to be showed (or autoscroll)

4th May 2011, 18:21
I want to have something like 'autoscroll' or 'autofocus' or 'ensurevisible' when use the keys up, down, right, left to move across the cells of my custom table view. (That is to say, when I go to cells whose row or column is greater than visibles)
Have I to reimplement some function ? Any property ?

Any idea ? Thanks

4th May 2011, 19:10
What exactly is the problem? To scroll the view simply change the values of its scrollbars.

5th May 2011, 09:04
The problem is when you are using up-down-right-left keys.
If you are viewing 5 columns, when you go to the 6th yor selected cell is hidden and you must to use the mouse to scroll horizontally.
I want to know the way to :
- to Know if the actual cell is hidden
- to force visibility
- to sincronize the top-left visible (if exist) first cell to let my cell to be visible.

Further, if you are at cell 23 x 33 (for example) and you press ctrl+home, the selected cell is now the 0,0 , but you doesn't view it. .....


5th May 2011, 10:11
Have a look at QAbstractItemView::scrollTo().

5th May 2011, 10:26
Thank wy, it works !!
I have to reimplement currentchanged and then call to scrollto.
I think this is the way , isn't ?
Thanks agains.