Hi,
I need to plot a curve within a rectangle, the min/max of curve data will be mapped to the edge of the rectangle. In doing so, I create a QTransform, which is
QTransform xf;
xf.scale( rect_width / ( curveMax - curveMin ), 1 ); // assuming no scaling in Y
xf.translate( -curveMax, 0 ); // assuming no translation in Y, but really, should I scale first, or translate first?
After creating the transform, where do I need to set it to? The QPainter inside paint() method or the GraphicsCurveItem itself?
I first set it to QPainter, and then change to set it to GraphicsCurveItem. In theory, they should not be any difference as the curve has no children. However, one of them caused GraphicsCurveItem's parent's sibling to be drawn in a wrong place (it appears to draw the scene more than once too), but if I resize the view, it redraws the things in the right place...
Any idea? Thanks
Bookmarks