PDA

View Full Version : scroll area like QGraphicsItem



Gopala Krishna
24th January 2008, 10:10
hi,
I am actually in need to implement an item to represent 2-d graphs and some more complicated graphs.
As the graph can be pretty huge, it should be scrollable.
My approach is to use a set of custom items and group to build the graph
For eg scrollbars will be custom item.

I am planning to use an approach something similar to QScrollArea but more simple. The ScrollAreaItem should host an item which represents the actual graph - say "canvas". Resizing the scrollarea should update the scrollbars, and also should indicate the visible area of canvas. The canvas in turn should use this hint to draw graph.

is this feasible ? Will clipping result in very bad performance ?
And btw i have to do this for qt 4.3 so can't use widgetitems. Also i can't use the lab's qgraphicswidget because it doesn't allow transformation.

wysota
7th February 2008, 12:28
I suggest you implement the item from scratch yourself and do the drawing using QStyle - you'll be able to handle the scrollbars without much effort then.