基本上用QPainter就可以实现
1.
QPainter painter(this);
//开始的标志(可以不用)
painter.begin(this);
//保存最初的设置
painter.save();
//设置去锯齿
painter.setRenderHint(QPainter::Antialiasing, true);
//设置画笔形式(外侧轮廓)
painter.setPen(QPen(QColor(79, 236, 190), 2));
//设置矩形区域
QRectF rectbutton = QRectF(1,1,82,82);
//绘制填充中间的颜色
painter.setBrush(QColor(191, 189, 189, 200));
//绘制椭圆
painter.drawEllipse(rectbutton);
//绘制“对号”
painter.setPen(QPen(QColor(79, 236, 190), 3));
painter.drawLine(QLine( QPoint(32.5*g_dscale, 41.0*g_dscale), QPoint(40.5*g_dscale, 50.0*g_dscale)));
painter.setPen(QPen(QColor(79, 236, 190), 3.5));
painter.drawLine(QLine( QPoint(40.5*g_dscale, 50.0*g_dscale), QPoint(57*g_dscale, 30*g_dscale)));
//最后更新(一定要)
update();
根本用不上传入的参数,坐标系原点是控件的左上角;