How can I create a "pie" using QGraphics.
Unsolved
General and Desktop
-
Hello forum, I want create a piece of pie using QGraphics, now I just get create a triangle but I need create a triangle with an arc (really a piece of pie). I saw an example using QPainter but my project is created using QGrapchics.
Now I made an QPolygon:
QPolygon triangle_s1;
triangle_s1 << QPoint(0,0); triangle_s1 << QPoint(x1_s1,y_s1); triangle_s1 << QPoint(x2_s1,y_s1); triangle_s1 << QPoint(0,0);
where x1_s1, x2_s1 and y_s1 are the coordinates for my triangle and I don't know how can I create the arc and paint inside my pie.
So.. if somebody could help me I would very grateful.
-
-
Maybe this example might be helpful too: https://doc.qt.io/qt-5/qtwidgets-itemviews-chart-example.html
It's not usingQGraphics
but it might help you figuring out some parts of the drawing logic or similar.