get new point coordinates on a rect after applying transformation
Solved
General and Desktop
-
I rotated a rect to 90 on its center. P is point on initial rect,
QPoint P(x,y);qreal angle = ...;
QRect rect = ...;
Qpoint center = rect.center();
QTransform t = QTransform().translate( center.x(), center-y() ).rotate( angle ).translate( -center.x(), -center.y() );
Qrect rotatedRect = t.mapToRect( rect );Now how to get new coordinated of P on rotatedRect ?