Horizontal automatic scrolling treeview - what can we do with

Harald Hvaal haraldhv at stud.ntnu.no
Thu Apr 10 15:10:50 BST 2008


Yes, I agree that it can be confusing to some users. On top of it, it is 
as of now quite aggressive when it comes to always keeping the left side 
aligned. I think making it a little softer and non-intrusive would 
quickly make people see (and get used to) that it autoscrolls.

And as aseigo hinted, I have now put a skeleton in the playground, under 
playground/libs/ui/ktreeview.
I was planning to add the actual scrolling code today, but hit a wall 
when I realized I don't know how to handle private signals/slots 
together with d-pointers (where do I define them if the d-pointer class 
is not private?)

Harald

> I liked it, but I think that`s a thing that will first confuse the users.
> 
> 
> On Thu, Apr 3, 2008 at 9:39 PM, Harald Hvaal <haraldhv at stud.ntnu.no> wrote:
>> Hello everybody
>> 
>> I've been playing around with a subclassed treeview that has no
>> horizontal scrolling, but instead scrolls automatically according to
>> the topmost visible item in the tree. The result can be seen here:
>> 
>> http://folk.ntnu.no/haraldhv/simplescroll.ogg
>> 
>> The code really just boils down to some settings and a timer doing 
>> something like this:
>> 
>> void timertick() { QModelIndex i = indexAt(QPoint(20,10));
>> 
>> if (i.isValid()) { scrolltowards = visualRect(i).left() - 20 + 
>> horizontalScrollBar()->value(); }
>> 
>> int diff = scrolltowards - horizontalScrollBar()->value(); if (diff >
>> 5)
>> 
>> horizontalScrollBar()->setValue(horizontalScrollBar()->value() + 4); 
>> else if (diff < -5)
>> 
>> horizontalScrollBar()->setValue(horizontalScrollBar()->value() - 4);
>> 
>> }
>> 
>> If there was a KTreeView it could easily be added to this, but since
>> there are none, I'm unsure of where it could fit. Also, the animation
>> could probably be done in a more correct way by using some kde
>> animation functionality(?).
>> 
>> 
>> What do you people see this go into?
>> 
>> Harald metellius at freenode
>> 
> 
> 
> 
> -- 
> Um Computador sem Windows é como um Navio sem dançarinas de Can-Can






More information about the kde-core-devel mailing list