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 :
Qt Code:
  1. starPolygon << QPointF(1.0, 0.5);
  2. for (int i = 1; i < 5; ++i)
  3. starPolygon << QPointF(0.5 + 0.5 * std::cos(0.8 * i * 3.14),
  4. 0.5 + 0.5 * std::sin(0.8 * i * 3.14));
To copy to clipboard, switch view to plain text mode 

Star drawing :
Qt Code:
  1. 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.