diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-11-17 15:37:21 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2014-11-18 11:16:56 +0100 |
commit | 87636ec58251b568a09695ab5bb7e44ecb296a28 (patch) | |
tree | aca951843520fe9d4931c67c711b0f2867163e1c /src/gui/painting | |
parent | 6f66205bacec923d989fa129796d5bd7e3786e4d (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/gui/painting')
-rw-r--r-- | src/gui/painting/qbrush.cpp | 3 |
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; } |