On Nov 17, 5:08 pm, "Edward K. Ream" <[EMAIL PROTECTED]> wrote: > On Ubuntu QTreeWidget.scrollToItem has some unpleasant behavior: a > horizontal scroll happens often when not needed to show the selected > headline. Furthermore, moving left in the tree often does not undo > the scroll. This is annoying. The XP tree widget is better in this > regard. > > Clearly, this can be fixed, but it's not enough to save and restore > the position of the horizontal scroll bar. Instead, the horizontal > position of the underlying scroll rect must be saved/restored. It's > probably a just a few lines of elementary math, but I've always found > such things hard to get right. So this is a "project".
I've just sent the following to the PyQt people: QQQ 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. QQQ Edward --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en -~----------~----~----~----~------~----~------~--~---
