1、官網
https://sourceforge.net/projects/qroundprogressbar/
2、下載並加入到工程

3、在ui里拖一個widget,提升為QRoundProgressBar
4、直接使用
ui->round_1->setFormat("%v"); ui->round_1->setMaximum(100); ui->round_1->setMinimum(0); ui->round_1->setDecimals(0); ui->round_1->setValue(20);

可參考:
https://blog.csdn.net/liang19890820/article/details/51957568
ps:
一、實現此界面

1、修改源碼,整個widget的背景色

2、修改源碼,外圓邊框+外圓環顏色

3、修改源碼,內圓邊框顏色

4、對象初始化,設置內圓填充顏色
//基本信息
ui->round_1->setFormat("%v"); ui->round_1->setMinimum(0); ui->round_1->setDecimals(0); ui->round_1->setValue(20);
//圓環漸變色 QGradientStop stop1,stop2; stop1.first = 0;stop1.second = QColor(38,193,137); stop2.first = 1;stop2.second = QColor(38,193,137); QGradientStops s; s.append(stop1); s.append(stop2); ui->round_1->setDataColors(s);
//內圓的填充色 QPalette paltte; paltte.setBrush(QPalette::AlternateBase, QColor(1,23,68)); paltte.setColor(QPalette::Text, Qt::white); ui->round_1->setPalette(paltte);
二、查看工程的例子
下載工程之后【git、官網】,打開其test文件夾里的工程,運行

