Save a detach if QBrush::setColor does not change the brush color

We can save detaching a QBrush when setColor is called trying to set
the current color.

Change-Id: I8f4042325d0f9c2bda69d469d6861e3cc310f329
Reviewed-by: Samuel Rødal <srodal@gmail.com>
This commit is contained in:
Allan Sandfeld Jensen 2014-11-17 15:37:21 +01:00 committed by Allan Sandfeld Jensen
parent 6f66205bac
commit 87636ec582

View File

@ -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;
}