首页 > TAG信息列表 > setPen

Qt QWidget绘制圆角注意事项

1、产生黑边 painter.setPen(Qt::NoPen); // 不设置画笔即可   2、背景不透明 this->setAttribute(Qt::WA_TranslucentBackground, true);   3、大致代码 this->setAttribute(Qt::WA_TranslucentBackground, true); void widget::paintEvent(QPaintEvent *) { QPainter