实现功能:使用 image 填充圆角 QWidget
/*QPainter painter(this);
painter.drawImage(0, 0, image); */
QPainter painter(this);
QBrush brush;
/*
If you don't like monochrome image
You are ought to read document about
QBrush::setTextureImage
*/
brush.setTextureImage(QImage(image));
painter.setBrush(brush);
painter.setPen(Qt::black);
painter.drawRoundedRect(this->rect(), 10, 10);