Hi everyone,
Can someone explain me how with only 5 points, they manage to draw a star having 10 points ?
https://doc.qt.io/qt-5/qtwidgets-ite...e-example.html
Star points :
for (int i = 1; i < 5; ++i)
starPolygon <<
QPointF(0.5 + 0.5 * std
::cos(0.8 * i
* 3.14),
0.5 + 0.5 * std::sin(0.8 * i * 3.14));
starPolygon << QPointF(1.0, 0.5);
for (int i = 1; i < 5; ++i)
starPolygon << QPointF(0.5 + 0.5 * std::cos(0.8 * i * 3.14),
0.5 + 0.5 * std::sin(0.8 * i * 3.14));
To copy to clipboard, switch view to plain text mode
Star drawing :
painter->drawPolygon(starPolygon, Qt::WindingFill);
painter->drawPolygon(starPolygon, Qt::WindingFill);
To copy to clipboard, switch view to plain text mode
Apparently, it's "Qt::WindingFill" that does the magic but it's not obvious.
Thanks.
Bookmarks