<div dir="ltr"><div><div><div><div><div>Hi,<br><br></div>I have an application with a tree view that has a rather large tree inside it. I've tweaked the tree view header so the tree view's horizontal scrollbar works as I'd like, as documented here:<br>
<br><a href="http://qt-project.org/faq/answer/how_can_i_ensure_that_a_horizontal_scrollbar_and_not_an_ellipse_shows_up_wh">http://qt-project.org/faq/answer/how_can_i_ensure_that_a_horizontal_scrollbar_and_not_an_ellipse_shows_up_wh</a><br>
<br></div>However, I notice that when I use the arrow keys to navigate a tree view, every time I press the "Down" arrow on the keyboard to select a new tree view item, the horizontal scrollbar resets itself to show the left-hand-most content in the view.<br>
<br></div>I have a minimal example that shows the problem:<br><br><a href="http://paste.ubuntu.com/7214797/">http://paste.ubuntu.com/7214797/</a><br><br></div>Run it, expand the tree with the arrow keys till it's off the right-hand edge of the window. Move the scrollbar to the right, and try moving around with the keyboard.<br>
<br></div>Ideally, the horizontal scrollbar would move left/right to keep the currently selected item's text in view.<br><br>Does anyone know if this can be achieved? I imagine I'd need to override or set something in QAbstractItemView, but the documentation for that class seems rather opaque to me.<br>
<br>Cheers,<br clear="all"><div><div><div><div><div><div><br>-- <br>Thomi Richards<br>
</div></div></div></div></div></div></div>