hi all,
I want to change the shape of qwidget.I want my widget to have round rectangle shape.
How to do it??
hi all,
I want to change the shape of qwidget.I want my widget to have round rectangle shape.
How to do it??
hi,
I have tried setMask but didnt get the desired result
How can i do it .Can you explain more.
did you see an example in QTDIR/examples/widgets/shapedclock?
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
Here is my example:
Qt Code:
void ShapedMenu::roundCorner() { 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.
Welcome to My Chinese Qt Blog (Google Translate Integrated) - http://www.xlrw.co.cc
Dedicated to make Qt popular in Chinese-speaking society.
Bookmarks