From 87636ec58251b568a09695ab5bb7e44ecb296a28 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 17 Nov 2014 15:37:21 +0100 Subject: [PATCH] Save a detach if QBrush::setColor does not change the brush color MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We can save detaching a QBrush when setColor is called trying to set the current color. Change-Id: I8f4042325d0f9c2bda69d469d6861e3cc310f329 Reviewed-by: Samuel Rødal --- src/gui/painting/qbrush.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp index d120175108..d136f3a903 100644 --- a/src/gui/painting/qbrush.cpp +++ b/src/gui/painting/qbrush.cpp @@ -708,6 +708,9 @@ void QBrush::setStyle(Qt::BrushStyle style) void QBrush::setColor(const QColor &c) { + if (d->color == c) + return; + detach(d->style); d->color = c; }