void MainWindow::resizeEvent(QResizeEvent*) { QBitmap maskBitmap(width(), height()); maskBitmap.clear(); QPainter p(&maskBitmap); p.setBrush(Qt::black); p.drawRoundRect(0, 0, width(), height(), 20, 30); p.end(); setMask(maskBitmap); }
void CaMifIconEngine::cacheBitmapL() { CFbsBitmap *bitmap(0); CFbsBitmap *maskBitmap(0); TInt bitmapIndex = 0; TInt maskIndex = 1; TPtrC16 filename( reinterpret_cast<const TUint16*>(mMifFilename.utf16())); // it will change bitmap ids if it is mif (checking inside) AknIconUtils::ValidateLogicalAppIconId( filename, bitmapIndex, maskIndex ); AknIconUtils::CreateIconLC( bitmap, maskBitmap, filename, bitmapIndex, maskIndex ); mBitmapCached = bitmap; mMaskBitmapCached = maskBitmap; // bitmap and icon, AknsUtils::CreateIconLC doesn't specify the order CleanupStack::Pop(2); }