How can I do that?

I tried this:
Qt Code:
  1. eventView = new QGraphicsView(ui.centralWidget);
  2. eventView->setGeometry(QRect(5, 60, 591, 81));
  3. eventView->setFrameShape(QFrame::Box);
  4. eventView->setFrameShadow(QFrame::Plain);
  5.  
  6. eventScene = new scene;
  7.  
  8. eventView->setScene(eventScene);
  9. eventScene->setSceneRect(0, 0, 480000, 50);
  10.  
  11. QPointF a = eventView->mapToScene(0, 0);
  12.  
  13. eventScene->addRect(QRectF(a.x(), a.y(), 100, 12), QPen(Qt::green), QBrush(Qt::blue));
  14. eventScene->addRect(QRectF(a.x(), a.y()+12, 100, 12), QPen(Qt::red), QBrush(Qt::yellow));
To copy to clipboard, switch view to plain text mode 

but when I then scale the whole thing with let's say
Qt Code:
  1. eventView->scale(2, 2);
To copy to clipboard, switch view to plain text mode 
the blue box is cut away, because the top left corner is no longer (0,-14) but (0,0)!

And that is a problem for me. Any help further is really appreciated!

Erlend Graff