Hey guys,
Would anyone know why this works:
painter.setWorldTransformation(...);
..
const QTransform & xform = painter.transform();
painter.save();
painter.setWorldTransform(QTransform());
painter.drawLine(pt1, pt2);
painter.restore();
QPainter painter(obj);
painter.setWorldTransformation(...);
..
const QTransform & xform = painter.transform();
QPoint pt1 = xform.map(QPoint(x1, y1));
QPoint pt2 = xform.map(QPoint(x2, y2));
painter.save();
painter.setWorldTransform(QTransform());
painter.drawLine(pt1, pt2);
painter.restore();
To copy to clipboard, switch view to plain text mode
but doing it directly does not:
painter.setWorldTransformation(...);
..
painter.drawLine(x1, y1, x2, y2);
QPainter painter(obj);
painter.setWorldTransformation(...);
..
painter.drawLine(x1, y1, x2, y2);
To copy to clipboard, switch view to plain text mode
?
I got drawRect to work with this transform, but I cannot get lines to behave. I've been all over the QPainter, QPen, and QTransform docs, but I haven't found anything to explain this.
Thanks,
-Chris
Bookmarks