QDialog 设置成圆角
void paintEvent(QPaintEvent *event) { Q_UNUSED(event); QBitmap bmp(this->size()); bmp.fill(); QPainter p(&bmp); p.setPen(Qt::NoPen); p.setBrush(Qt::black); p.drawRoundedRect(bmp.rect(),15,20); setMask(bmp); }
void paintEvent(QPaintEvent *event) { Q_UNUSED(event); QBitmap bmp(this->size()); bmp.fill(); QPainter p(&bmp); p.setPen(Qt::NoPen); p.setBrush(Qt::black); p.drawRoundedRect(bmp.rect(),15,20); setMask(bmp); }