Hello, everyone.

So, I have a class called TwoDotsGraphicsScene which subclasses QGraphicsScene. In some place I add a QGraphicsGroup to it, where one of the items is QGraphicsLineItem:

Qt Code:
  1. //some code....
  2.  
  3. secondPoint = new QGraphicsItemGroup(0);
  4. QLineF perpendicLine(QLineF(firstPoint->scenePos(), point).normalVector().unitVector());
  5. perpendicLine.setLength(200);
  6. QPointF centerPoint = perpendicLine.pointAt(0.5);
  7. perpendicLine.translate(-centerPoint.x(), -centerPoint.y());
  8.  
  9. perpLine = new QGraphicsLineItem(perpendicLine);
  10. perpLine->setPen(QPen(Qt::red));
  11. secondPointGroup->addToGroup(perpLine);
  12.  
  13. this->addItem(secondPoint);
  14.  
  15. //some code....
To copy to clipboard, switch view to plain text mode 

perpLine - is a class public variable.

Next. This class has a slot correctLineAngle(int angle), in which I'd like to change a line's angle:

Qt Code:
  1. void TwoDotsGraphicsScene::correctLineAngle(int angle)
  2. {
  3. if(secondPoint == NULL)
  4. return;
  5.  
  6. qDebug() << "agnle " << angle;
  7. perpLine->line().setAngle(angle);
  8. qDebug() << "lineAngle " << perpLine->line().angle();
  9.  
  10. calculateDistance();
  11. }
To copy to clipboard, switch view to plain text mode 

But debug output is kind of like:
lineAngle 93.7022
agnle 121
lineAngle 93.7022
agnle 127
lineAngle 93.7022
agnle 133
lineAngle 93.7022
agnle 136
lineAngle 93.7022
So, I guess setAngle not having an effect. What should I do?