adjust the coords of the disk to the coords of the view port

This commit is contained in:
Mikhail Bogdanov 2013-02-26 18:06:44 +01:00 committed by Aymeric PELLE
parent 1aa515b47a
commit 221d624d73
1 changed files with 7 additions and 0 deletions

View File

@ -185,6 +185,13 @@ MainWindow::MainWindow()
this->graphicsView->setScene(&scene); this->graphicsView->setScene(&scene);
this->graphicsView->setMouseTracking(true); this->graphicsView->setMouseTracking(true);
// we want to adjust the coordinates of QGraphicsView to the coordinates of QGraphicsScene
// the following line must do this:
// this->graphicsView->fitInView( scene.sceneRect(), Qt::KeepAspectRatio);
// It does not do this sufficiently well.
// Current solution:
this->graphicsView->shear(230, 230);
// Turn the vertical axis upside down // Turn the vertical axis upside down
this->graphicsView->matrix().scale(1, -1); this->graphicsView->matrix().scale(1, -1);