QBitmap bmp();QPainter p(&bmp);p.drawRoundRect(...);
#include <qapplication.h>#include <qwidget.h>#include <qbitmap.h>#include <qpainter.h>class MoveMe : public QWidget{public: MoveMe( QWidget *parent=0, const char *name=0, WFlags f = 0) :QWidget(parent,name, f) { setAutoMask(true); }protected: void updateMask() { QBitmap bm(width(), height()); bm.fill(Qt::color0); QPainter p(&bm); p.setBrush(Qt::color1); p.drawRoundRect(0, 0, width(), height()); setMask(bm); }};int main( int argc, char **argv ){ QApplication a( argc, argv ); MoveMe w(0,0); w.resize(320, 200); w.show(); a.setMainWidget(&w); return a.exec();}