Hi All,

Using Qt4.3 I’m using a QGraphicsScene and QGraphicsView to show small portion of a large image (4600x6000 pix) and draw symbols upon it. Works fine (AFAIK). I then use the same scene and view to show the same size portion of a larger image (8000, 5000). The symbols I draw do not show up, and paint is only called once. But if I scroll my scene to the left, about half-way through, paint starts getting called again, but when I scroll back to my starting point, no symbols are drawn.

It seems like I am not defining my view or scene properly, but I don’t see how to do it differently. I’m assuming as I scroll to the left and get to the half-way, my view is then showing the range of the first image, which was 4600 pixels wide.

For simplicity, I’m leaving out details of the classes which are doing the painting, etc.

Code snippet is below. Does anybody see what am I doing wrong?

bjh


Qt Code:
  1. // first image
  2.  
  3. view->setBackgroundBrush(QPixmao(image1));
  4. scene->setSceneRect(0, 0, 4600, 5500)
  5. view->resize(400, 300);
  6. // symbols drawn…
  7.  
  8. // second image
  9. scene->setSceneRect(0, 0, 8000, 5000);
  10. view->updateSceneRect(QRectF(0, 0, 8000, 5000));
  11. view->setbackgroundBrush(QPixmap(image2));
  12. // symbols not drawn…
To copy to clipboard, switch view to plain text mode