Stack allocation is better than heap.

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=851427
This commit is contained in:
Alex Merry 2008-08-23 16:21:49 +00:00
parent 1edb8aab86
commit bfe6bd2906

View File

@ -571,15 +571,16 @@ void AppletHandle::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
//mask when compositing is enabled. //mask when compositing is enabled.
//FIXME: the mask doesn't function correctly when zoomed out. //FIXME: the mask doesn't function correctly when zoomed out.
QBitmap bitmap(screenRect.size()); QBitmap bitmap(screenRect.size());
QPainter * shapePainter = new QPainter(); {
shapePainter->begin(&bitmap); QPainter shapePainter;
shapePainter->fillRect(0, 0, screenRect.width(), shapePainter.begin(&bitmap);
screenRect.height(), shapePainter.fillRect(0, 0, screenRect.width(),
Qt::white); screenRect.height(),
shapePainter->setBrush(Qt::black); Qt::white);
shapePainter->drawPath(m_applet->shape()); shapePainter.setBrush(Qt::black);
shapePainter->end(); shapePainter.drawPath(m_applet->shape());
delete shapePainter; shapePainter.end();
}
m_topview->setMask(bitmap); m_topview->setMask(bitmap);
m_topview->show(); m_topview->show();