QT 画任意角度图形_坐标系统

方法解释,画任意角度原理是旋转了painter.rotate(210);坐标轴,绘图结束后将坐标轴还原即可painter.restore();

    QPainter painter(this);
painter.save(); //保存原来坐标系统
painter.translate(200, 300);
painter.rotate(210); //坐标旋转degrees 度
painter.drawRect (60,30,50,40);
painter.drawEllipse (0,0,50,80);
painter.drawEllipse (0,0,5,6);
painter.restore(); //回复原来的坐标系统