通过qt图形视图绘制可拉伸矩形,圆等,并可随意旋转角度,继承qgraphicsitem if(isSelected()) { if(m_dir == Right && (event->buttons() & Qt::RightButton)){ double ang = 0; double x = m_cenPt.x()-m_movePoint.x(); double y = m_cenPt.y()-m_movePoint.y(); if(abs(x) > 0.001){ if(x < 0){ ang = atan(y/x)*180/PI; //通过弧度求角度 if(ang