If I understand you right, you simply want to rotate the line mid point:
QTransform t;
t.rotate(angle); // actually just figure it out yourself how to rotate around specified point
const QPoint mid
= (line.
p1()+line.
p2)/2;
const QPoint rotated_mid
= t.
map(mid
);
line.translate( rotated_mid-mid );
QLine line = ...;
QTransform t;
t.rotate(angle); // actually just figure it out yourself how to rotate around specified point
const QPoint mid = (line.p1()+line.p2)/2;
const QPoint rotated_mid = t.map(mid);
line.translate( rotated_mid-mid );
To copy to clipboard, switch view to plain text mode
You cannot rotate the start and end points separately, it will change the line direction (if angle != 0).
Bookmarks