[kde-edu]: attempt at a KPlotWidget replacement based on QGraphicsView

Albert Astals Cid aacid at kde.org
Tue Sep 5 20:18:33 CEST 2006

A Dimarts 05 Setembre 2006 03:20, Jason Harris va escriure:
> Hello,
> I spent the weekend trying to work out a replacement for KPlotWidget based
> on QGraphicsView.  It seemed like a good idea, because QGraphicsView
> already encapsulates the separation of Data space and pixel space, uses a
> model/view architecture, and is supposed to be fast.
> Unfortunately, I am rather disappointed with the results.  There's no easy
> way in QGraphicsView to accomodate the axis labels and tick labels, because
> the entire Widget is devoted to the View of the data; there's no way to set
> a QRect for the View that is smaller than the widget itself.  So I ended up
> creating a QFrame containing a 3x3 grid of widgets, where the center widget
> is the QGraphicsView, and the eight around the edge are to hold the axis
> information.  That's pretty ugly.
> It also seems much slower than the old KPlotWidget.  For example, when
> resizing the plot, there are noticeable redraw lags.  In general, it just
> feels like I am using a square peg for a round hole.
> It's possible that some of these shortcomings are just because I'm using
> the wrong approach, but I'm ready to give up on it.  If anyone else wants
> to try doing something with the code I've written, I can make it available.

Have you guys tried Qwt, specially QwtPlot? I use it at work and seems quite 



> Let me know,
> Jason

More information about the kde-edu mailing list