QT自定义进度条-画圆盘
六等分圆盘
void PaintWidget::paintEvent(QPaintEvent *e)
{
QPainter painter(this);
QPen pen;
//设置为抗锯齿,并且设置画笔颜色为浅灰
painter.setRenderHint(QPainter::Antialiasing);
painter.setPen(QColor(0x64,0x64,0x64));
painter.translate(this->width()/2, this->height()/2);
QRect rect_1(-270, -270, 540, 540); /*矩形 起始坐标x y width height*/
QPainterPath circle_1;
circle_1.arcTo(rect_1, 0, 360);