문제

I have a QTreeView with a custom item delegate. The delegate creates an editor that can be very wide (let's say, 2000px width), so the user will scroll horizontally to edit the data.

Step 1

Image 1: I scrolled to the frame #300. Notice that the scrollbar is already offseted.

Step 2 http://imageshack.us/a/img801/9887/image2zb.png

Image 2: I click some part of the editor; then the scrollbar goes to the starting position automatically. It happens because the current selected row have changed. Is there any way to disable the automatic scrolling?

Thanks!

도움이 되었습니까?

해결책

Solved with the property QAbstractItemView::autoScroll. So, all I had to do was myTreeView->setAutoScroll(false);.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top