[Qt-interest] Rotation of QAbstractGraphicsShapeItem

Jesús Fernández jsfdez at gmail.com
Tue Feb 17 16:00:23 CET 2009


Hi,

I have a QGraphisScene with QGraphicsEllipseItem and I want to rotate and
resize it. The problem is when I try to rotate it when it has been
previously resized+rotated it appears to change the center of the rect.

Here is my code:
void GraphicsEllipseLandmarkItem::setAngle(qreal angle)

{

  QPointF center=boundingRect().center();


    if(m_angle==angle) return;

    m_angle=angle;

   resetTransform();

   translate(center.x(), center.y());

  rotate(m_angle);

  translate(-center.x(), -center.y());

   emit angleChanged(angle);

}


Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090217/6a3cd178/attachment.html 


More information about the Qt-interest-old mailing list