Well, I tried the following and its not doing anything...
May be someone can point me to the right way?
//m_topLeft is a pixmap of a rounded upper left corener of the dialog
p.setClipping(true);
p.setClipRect(0,0,m_topLeft->width(),m_topLeft->height());
//m_topLeft->setMask(QBitmap("panel_top_left_mask.bmp")); //testing the QBitmap
if(!m_topLeft->isNull())
p.drawPixmap(0,0,*m_topLeft);
QPainter(this);
//m_topLeft is a pixmap of a rounded upper left corener of the dialog
p.setClipping(true);
p.setClipRect(0,0,m_topLeft->width(),m_topLeft->height());
p.setClipRegion(QRegion(QRect(m_topLeft->rect())).subtract(QRegion(QBitmap("panel_top_left_mask.bmp"))));
//m_topLeft->setMask(QBitmap("panel_top_left_mask.bmp")); //testing the QBitmap
if(!m_topLeft->isNull())
p.drawPixmap(0,0,*m_topLeft);
To copy to clipboard, switch view to plain text mode
Ther result is that the m_topLeft pixmap gets painted as it does with out the clipping, meaning, that the rest of the upper left corenr is also drawn (and not clipped)....
I made sure QBitmap is not null, with setting it as a mask to the QPixmap, attached is the result - you can see the black background resulting from the correct mask.
I am trying to get the balck area clipped...
Any pointers are welcome.
Thanks.
Bookmarks