simplify a bit, now Svg can return directly a pixmap

svn path=/trunk/KDE/kdelibs/; revision=1091013
This commit is contained in:
Marco Martin 2010-02-16 14:38:58 +00:00
parent 74ab090b72
commit bd87a3f3b7

View File

@ -725,14 +725,8 @@ QPixmap IconWidgetPrivate::decoration(const QStyleOptionGraphicsItem *option, bo
if (iconSvg) {
if (iconSvgElementChanged || iconSvgPixmap.size() != iconSize.toSize()) {
QImage img(iconSize.toSize(), QImage::Format_ARGB32_Premultiplied);
{
img.fill(0);
QPainter p(&img);
iconSvg->resize(iconSize);
iconSvg->paint(&p, img.rect(), iconSvgElement);
}
iconSvgPixmap = QPixmap::fromImage(img);
iconSvg->resize(iconSize);
iconSvgPixmap = iconSvg->pixmap(iconSvgElement);
iconSvgElementChanged = false;
}
result = iconSvgPixmap;