I am having problems with something that I thought would be simple ... but it is complicating me. I have a QGraphicsItem that has a line that goes from A to B. I need to turn the QGraphicsItem so that the line from A to B is quite straight on the Y axis (OSEA in DEFINITIVE, pointing to the NORTH!).
double refAB_2_North = 360 - QLineF(pointA, pointB).angle();
This code returns the degrees of the angle from the X axis to this line (I mean less than 90 degrees for the example below that I put the image). Now,
double giro = 90 - refAB_2North;
I should give me the angle that I need so that the line stops well straight on the Y axis.
this->rotate(giro);
I should rotate the QGraphicsItem and leave the line well stopped on the Y axis ... but it does not ... it does not remain at 90 degrees, it is more ... it even remains almost the same, just a little more inclined to the X axis. What is wrong ??? (I put an illustrative image because all the graphics would be many lines that embarrass)