Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to draw single-colour Ellipse (no black border) with QPainter

Code for the beginning:

QColor yellow("#f0d048");
Qt::BrushStyle style = Qt::SolidPattern;
QBrush brush(yellow, style);
painter.setBrush(brush);
painter.drawEllipse(10,10,10,10);

Everytime I do this, I get a yellow circle surrounded by a black 1-pixel-sized border. In total the circle will have the same size like if I draw with black colour, so what shall I do to just get a single-coloured yellow circle without black border?

Best regards

like image 674
Aragon Avatar asked Jun 30 '15 15:06

Aragon


1 Answers

Set a pen on painter

painter.setPen(Qt::NoPen);

Qt has 'brush' for filling figures, and 'pen' for drawing lines and outlines.

like image 64
Thalia Avatar answered Nov 13 '22 15:11

Thalia