I'm getting some odd behaviour with centerOn that I need to sort out. It's not putting the selected point in the centre of the screen.. it's scrolling past the screen centre even though I have made sure the view is set to Qt::AlignCenter.

eg:
Qt Code:
  1. myView->setAlignment(Qt::AlignCenter);
  2. myScene->importImages(selection);
  3. myScene->setSceneRect(myScene->itemsBoundingRect());
  4. qDebug() << "loadSelection #1" << myView->sceneRect() << myScene->sceneRect() << myScene->sceneRect().center() << myView->mapFromScene(myScene->sceneRect().center()) << myView->mapFromScene(QPointF(0.0,0.0));
  5. myView->centerOn(myScene->sceneRect().center());
  6. qDebug() << "loadSelection #2" << myView->sceneRect() << myScene->sceneRect() << myScene->sceneRect().center() << myView->mapFromScene(myScene->sceneRect().center()) << myView->mapFromScene(QPointF(0.0,0.0));
To copy to clipboard, switch view to plain text mode 
gives the result:
Qt Code:
  1. [Qt Message] loadSelection #1 QRectF(0,0 1358x1028.39) QRectF(0,0 1358x1028.39) QPointF(679, 514.194) QPoint(679,514) QPoint(0,0)
  2. [Qt Message] loadSelection #2 QRectF(0,0 1358x1028.39) QRectF(0,0 1358x1028.39) QPointF(679, 514.194) QPoint(48,122) QPoint(-631,-392)
To copy to clipboard, switch view to plain text mode 

as you can see, the centre is actually placed at (48, 122) instead of where it should be at (180, 320) on a view of (360, 640).

Any ideas?