graphicsView->resetTransform();
double ratio = image->width() / (double)scale.width();
mapScene->addItem(pic);
if ( showOffset ) {
mapScene
->addLine
( offX
/ratio,
-graphicsView
->height
(), offX
/ratio, graphicsView
->height
(),
QPen(QColor(0,
0,
0)) );
mapScene
->addLine
( -graphicsView
->width
(), offY
/ratio, graphicsView
->width
(), offY
/ratio,
QPen(QColor(0,
0,
0)) );
} //makes lines bigger than the view to ensure they take up the whole view, but stops centerOn to work propery in 4.6
graphicsView->centerOn(pic);
graphicsView->resetTransform();
double ratio = image->width() / (double)scale.width();
mapScene->addItem(pic);
if ( showOffset ) {
mapScene->addLine( offX/ratio, -graphicsView->height(), offX/ratio, graphicsView->height(), QPen(QColor(0,0,0)) );
mapScene->addLine( -graphicsView->width(), offY/ratio, graphicsView->width(), offY/ratio, QPen(QColor(0,0,0)) );
} //makes lines bigger than the view to ensure they take up the whole view, but stops centerOn to work propery in 4.6
graphicsView->centerOn(pic);
To copy to clipboard, switch view to plain text mode
Bookmarks