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:
parent
6f66205bac
commit
87636ec582
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user