[PyQt] Wretched horizontal scrolling of QTreeWidget on Linux
Vicent Mas
uvemas at gmail.com
Tue Nov 18 15:26:42 GMT 2008
Hi,
you could catch the itemSelectionChanged() signal, then get the currently
selected item with selectedItems() and then call scrollToItem() slot. Note
that you can play with several scroll hint values in the scrollToItem method.
I haven't tested it, sorry.
Hope it helps.
El Tuesday 18 November 2008 Edward K. Ream escribió:
> On XP, a QTreeWidget never scrolls horizontally automatically, and
> that works well in practice.
>
> On Linux, a QTreeWidget will typically scroll horizontally when an
> item to the right of the present item is selected programatically,
> i.e., not with the mouse, but with code triggered from a keystroke.
> Worse, scrolling doesn't get restored to zero horizontal offset when a
> "leftward" item is selected. Not good.
>
> I don't see any options/methods that have any chance of affecting
> this. Saving and restoring scrollbar positions does not work.
> Presumably one could dig deep into QAbstractScrollArea to save and
> restore the underlying scroll rect, but this is going to be far from
> fun.
>
> Anyone have any suggestions, or sample code? Thanks.
>
> Edward
> --------------------------------------------------------------------
> Edward K. Ream email: edreamleo at gmail.com
> Leo: http://webpages.charter.net/edreamleo/front.html
> --------------------------------------------------------------------
> _______________________________________________
> PyQt mailing list PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
--
::
Share what you know, learn what you don't
More information about the PyQt
mailing list