summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2014-11-17 15:37:21 +0100
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2014-11-18 11:16:56 +0100
commit87636ec58251b568a09695ab5bb7e44ecb296a28 (patch)
treeaca951843520fe9d4931c67c711b0f2867163e1c /src
parent6f66205bacec923d989fa129796d5bd7e3786e4d (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/gui/painting/qbrush.cpp3
1 files changed, 3 insertions, 0 deletions
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;
}