I'm trying to rotate a QGraphicsItem on its own center, so it does not move its center, just turn X degrees ... I can not make it happen, it changes places, as if the whole scene were spinning but the rest of the Elements do not turn ... but he turns but not over his center. I leave the code to see if they give me a hand. Thanks a thousand.
QRectF rect;
rect = engine->boundingRect();
QPointF center = rect.center();
qreal angle = grade;
QTransform t;
t.translate(center.x(), center.y());
t.rotate(angle);
t.translate(-center.x(), -center.y());
engine->setPos(t.map(engine->pos()));
engine->setRotation(engine->rotation() + angle);
Engine is the QGraphicsItem that I want to rotate on its center ...