rendered paste bodyQBitmap roundMask(QSize size, bool square){ // QRegion region = VisualUtil::roundedMask(size, cornerRadius, !square ? VisualUtil::TopBorders : VisualUtil::NoBorders); QBitmap bmp(size); QPainter p(&bmp); p.fillRect(QRect(QPoint(0, 0), size), Qt::color1); // bmp.clear(); if (!square) { QBitmap topLeftCorner(":top_left_corner_mask_8px.bmp"); p.fillRect(QRect(QPoint(0, 0), topLeftCorner.size()), Qt::color0); p.fillRect(QRect(QPoint(size.width()-topLeftCorner.width(), 0), topLeftCorner.size()), Qt::color0); // p.setBackgroundMode(Qt::OpaqueMode); // p.fillRect(QRect(QPoint(0, 0), topLeftCorner.size()), Qt::color0); p.drawPixmap(0, 0, topLeftCorner); p.translate(size.width(), 0); QMatrix matrix = p.worldMatrix(); matrix.rotate(90); p.setWorldMatrix(matrix); // p.fillRect(QRect(QPoint(0, 0), topLeftCorner.size()), Qt::color0); // p.drawPixmap(0, 0, topLeftCorner); } return bmp;}