qt QGraphicsItem 绕轴旋转问题
1.我用Qt图形视图框架,对QGraphicsItem进行旋转,发现他是以屏坐标系统进行旋转的,不是以自己坐标系统旋转。
2.我先把QGraphicsIte 绕Z轴平面旋转一定角度,然后再把QGraphicsItemY轴旋转。
我想以QGraphicsItem自己坐标系统旋转。但它却以标准坐标屏旋转。
有什么方法可以解决不。
以下是我的代码
resetTransform();
QTransform transformf = transform();
r += 20;
qreal x = boundingRect().center().x();
qreal y = boundingRect().center().y();
transformf.translate(boundingRect().center().x(),boundingRect().center().y() );
transformf.rotate(r, Qt::XAxis);
transformf.translate( - boundingRect().center().x(),-boundingRect().center().y() );
setTransform(transformf);