The mask does not work with QRect(0, 0, ui->widget->width(), ui->widget->height()
.
QBitmap windowMask(ui->widget->width(), ui->widget->height());
windowMask.fill(Qt::transparent);
QPainter p(&windowMask);
//
p.fillRect(QRectF(0, 0, ui->widget->width(), ui->widget->height()), Qt::white);
p.end();
ui->widget->setMask(windowMask);
But it work fine with 1px more
p.fillRect(QRectF(1, 1, ui->widget->width(), ui->widget->height()), Qt::white);
How do I cover the entire widget?