Edit: 增加更多信息。
我愿轮流使用<条码>QPolygonF。 a. 来源如下:
象这个多功能(图像中心是来源——<代码>0, 0):
https://i.stack.imgur.com/08ImV.png” alt=“first polygon”/>
To rotate clockwise so that it ends up here:
www.un.org/Depts/DGACM/index_french.htm 上面图象中第一组位置相同:
QPolygonF p1 = QPolygonF() << QPointF(0, 1) << QPointF(4, 1) << QPointF(4, 2) << QPointF(0, 2);
接着,我轮值了我认为正确的来源(2, 2
):
QTransform t;
t.translate(2, 2);
t.rotate(-90);
t.translate(-2, -2);
QPolygonF p2 = t.map(p1);
qDebug() << p1 << "rotated = " << p2;
产出:
QPolygonF(QPointF(0, 1) QPointF(4, 1) QPointF(4, 2) QPointF(0, 2) ) rotated = QPolygonF(QPointF(1, 4) QPointF(1, 0) QPointF(2, 0) QPointF(2, 4) )
当我想要的产出是:
QPolygonF(QPointF(0, 1) QPointF(4, 1) QPointF(4, 2) QPointF(0, 2) ) rotated = QPolygonF(QPointF(2, 0) QPointF(3, 0) QPointF(3, 4) QPointF(2, 4) )
但是,根据上述产出,多角将最终考虑:
在什么时候,我应轮流?