Here is my example:
void ShapedMenu::roundCorner()
{
painter.fillRect(pixmap.rect(), Qt::white);
painter.setBrush(Qt::black);
painter.drawRoundRect(pixmap.rect(), 10, 10);
setMask(pixmap.createMaskFromColor(Qt::white));
}
void ShapedMenu::roundCorner()
{
QPixmap pixmap(size());
QPainter painter(&pixmap);
painter.fillRect(pixmap.rect(), Qt::white);
painter.setBrush(Qt::black);
painter.drawRoundRect(pixmap.rect(), 10, 10);
setMask(pixmap.createMaskFromColor(Qt::white));
}
To copy to clipboard, switch view to plain text mode
You could customize the pixmap by design it with Photoshop, CorelDRAW, etc.
Bookmarks