I have a QGraphicsEllipseItem which I would like to rotate, but place on a certain location of the scene. I can get it to rotate, but it seems to automatically place the ellipse somewhere else on the scene. This is a snippit of the code I have so far, any help would be appreciated.
ellipse->rotate(45.0);
// Tried the following with no success:
// ellipse->setPos(x,y);
// ellipse->setPos(ui.graphicsView->mapFromScene(x,y));
// ellipse->setPos(ui.graphicsView->mapToScene(x,y));
scene->addItem(ellipse);
ellipse = new QGraphicsEllipseItem(x-1, y-7, 2, 7);
ellipse->rotate(45.0);
// Tried the following with no success:
// ellipse->setPos(x,y);
// ellipse->setPos(ui.graphicsView->mapFromScene(x,y));
// ellipse->setPos(ui.graphicsView->mapToScene(x,y));
scene->addItem(ellipse);
To copy to clipboard, switch view to plain text mode
Bookmarks