|
1Qter豆
在scene中,点击左旋右旋后,记录旋转角度在m_rotateAngle,
QPixmap bgPixmap(posWidth,posHeight);
bgPixmap.fill(Qt::white);
QGraphicsPixmapItem* curBg = new QGraphicsPixmapItem(bgPixmap);
this->addItem(curBg);
QPointF center = curBg->boundingRect().center();
curBg->setTransformOriginPoint(center);
curBg->setRotation(m_rotateAngle);
curBg->setPos(0,0);//posX,posY
首先旋转,然后平移setpos,因为旋转后图形超出scenerect,导致一部分图形没有显示出来,且旋转多次后代码跑飞,求助如何实现左旋右旋,
|
|