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:
Friedemann Kleint
2017-02-06 12:25:15 +01:00
parent 148e793dec
commit ce088cb754
3 changed files with 3 additions and 0 deletions

View File

@@ -326,6 +326,7 @@ void FancyToolButton::hoverOverlay(QPainter *painter, const QRect &spanRect)
p.setPen(QPen(grad, 1.0));
p.drawLine(borderRect.topLeft(), borderRect.topRight());
p.drawLine(borderRect.bottomLeft(), borderRect.bottomRight());
p.end();
QPixmapCache::insert(cacheKey, overlay);
}