avant
30th May 2010, 19:43
I am writing a program to display and export specialized graph data. The graphs are fairly non-standard, so I suspect that Qwt is not an option. As a result, I want to be able to draw these graphs myself.
The problem is that I need to be able to do a selection zoom (QRubberBand) on an area, scaling the graph elements in that area, but leaving the axes exactly where they are and simply redraw the axis labels accordingly. I assume that I cannot use QGraphicsView's scaling, as I don't want scrollbars. So the scene must be redrawn whenever zooming occurs.
What is the best way to ensure that each item will be redrawn according to the new zoom level? Do I group items with the same behavior? Do I write a specialized QGraphicsScene class to handle the scaling of each item?
I can't find any good examples to get started with, so any help would be appreciated.
The problem is that I need to be able to do a selection zoom (QRubberBand) on an area, scaling the graph elements in that area, but leaving the axes exactly where they are and simply redraw the axis labels accordingly. I assume that I cannot use QGraphicsView's scaling, as I don't want scrollbars. So the scene must be redrawn whenever zooming occurs.
What is the best way to ensure that each item will be redrawn according to the new zoom level? Do I group items with the same behavior? Do I write a specialized QGraphicsScene class to handle the scaling of each item?
I can't find any good examples to get started with, so any help would be appreciated.