I have implemented what is essentially a map on which the user can draw crosses to indicate points. The map itself is a subclassed QGraphicsView and the crosses are two QGraphicsLineItems. When the user zooms/drags on the map, I want the crosses to move with the map, but not to grow in size.

I draw the crosses with two lines:
Qt Code:
  1. QGraphicsLineItem *line_ver = this->scene()->addLine(pt.x(), pt.y()-100, pt.x(), pt.y()+100, QPen(Qt::yellow, 3));
  2. QGraphicsLineItem *line_hor = this->scene()->addLine(pt.x()-100, pt.y(), pt.x()+100, pt.y(), QPen(Qt::yellow, 3));
To copy to clipboard, switch view to plain text mode 

Then I set them to ignore transformations:
Qt Code:
  1. line_ver->setFlag(QGraphicsItem::ItemIgnoresTransformations, true);
  2. line_hor->setFlag(QGraphicsItem::ItemIgnoresTransformations, true);
To copy to clipboard, switch view to plain text mode 

This satisfies the first of my requirements, i.e., the crosses do not become larger when the user zooms in, and they also move along when the user drags the map. However, when the user zooms on the map, then the crosses move away from their original positions. Is there any flag I can set to prevent this, or any other way? Thanks!