Issue with QPolygonF and QGraphicsPolygonItem (brought a picture)
Unsolved
General and Desktop
-
Hello,
I seem to be having this unwanted black segment when drawing triangles. Here's what I did with the QPolygonF:
qreal root = qSqrt(3)/2; QPolygonF DownwardTriangle = QPolygonF(3); DownwardTriangle << QPointF(root, .5)*80 << QPointF(-root, .5)*80 << QPointF(0, -1)*80 << QPointF(root, .5)*80;
and here's how I added it to the QGraphicsScene:
auto foo = WindowScene.addPolygon(DownwardTriangle, QPen(), GrayBrush); foo->setPos(100, 100);
I tried both fillRules but I got the black segment (from the top-right corner to the center of the triangle) in both cases regardless. I can't get rid of it. The top-right corner matches the first and last QPointF that I stored inside
DownwardTriangle
(which isQPointF(root, .5)*80
).Any help would be appreciated. Thank you.
-
Thank you! The problem disappears if I drop the
= QPolygonF(3);
:)