I want to draw a special segmented circle like the below image.
But I cannot understand how to draw an arc or ellipse using the
setDashPattern
.
At first, I thought that just drawing a colored circle and drawing a transparent rect or line to covered it would work. But it just passed though...
Second, I tried the below code,
QPicture pi;
QPainter p(&pi);
QPen pen(Qt::red);
qreal space = 6;
qreal ine = 99;
pen.setDashPattern(QVector<qreal>() <<
line << space << line << space <<line << space);
p.drawRect(0,50, 100, 100);
p.end();
But this is not what I want it to do.
Does anyone know how to draw rings like this?