forked from qt-creator/qt-creator
Call QPainter::end() prior to QPixmapCache::insert()
Inserting a QPixmap with active painters on it causes it to do a deep copy of it, which is unnecessary. Task-number: QTBUG-58653 Change-Id: I49123ffcec2e12a01c87974b7a513d68a11185d4 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -455,6 +455,7 @@ void StyleHelper::drawIconWithShadow(const QIcon &icon, const QRect &rect,
|
||||
|
||||
// Draw the actual pixmap...
|
||||
cachePainter.drawPixmap(QRect(QPoint(radius, radius) + offset, QSize(px.width(), px.height())), px);
|
||||
cachePainter.end();
|
||||
cache.setDevicePixelRatio(devicePixelRatio);
|
||||
QPixmapCache::insert(pixmapName, cache);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user