Hi,
I am customising QuantumGIS that uses Qt's Qpainter to draw and paint...
I am trying to draw a polyline on the canvas that is coming as a update through message queues..the draw is very fine...but in the polyline or polygon objects that i get as an update also include an angle field that is to be used for rotation of an object. The problem is that when i try to rotate the line just before the polyline is drawn by the qpainter using painter.rotate() method,the line is rotated fine but the position of the line drawn changes..and it changes at every zoom and pan of the Qgis canvas.. Before setting painter.rotate() i am saving the painter state and after drawing- again restoring its state which i believe is analogous to OpenGL's push/popMatrix functions. Does the Qpainter's save restore functions work similar to push/popMatrix functions of opengl??
here is a code snippet:
p->save();
//p->rotate(45);
p->scale( 1.0 / rasterScaleFactor, 1.0 / rasterScaleFactor );
p->drawPolyline( pa );
p->restore();
Help is appreciated. Thanks.