How to draw a solid color ellipse (no black border) with QPainter
Code to start:
QColor yellow("#f0d048");
Qt::BrushStyle style = Qt::SolidPattern;
QBrush brush(yellow, style);
painter.setBrush(brush);
painter.drawEllipse(10,10,10,10);
Every time I do this, I get a yellow circle surrounded by a 1 pixel black border. In general, the circle will be the same size as if I painted with black, so what should I do to just get a solid yellow circle without a black border?
Regards
+3
Aragon
source
to share
1 answer
Install the pen on the artist
painter.setPen(Qt::NoPen);
Qt has a brush for filling shapes and a pen for drawing lines and outlines.
+5
Thalia
source
to share