From 9cd5c614559159fe09b414d568f88a192405b84d Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 12 Jan 2015 14:57:08 +0100 Subject: Avoid unneeded QBrush::texture() calls If a QBrush has been created without QPixmap the texture() method will create one. This patch avoids that in several places by checking the type of the texture brush before accessing it, or not accessing it at all. Task-number: QTBUG-43766 Change-Id: If6009fe1d5bd51b239ae2c838e5c3b904b56b11a Reviewed-by: Marc Mutz Reviewed-by: Gunnar Sletta --- src/widgets/styles/qfusionstyle_p_p.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/widgets/styles/qfusionstyle_p_p.h') diff --git a/src/widgets/styles/qfusionstyle_p_p.h b/src/widgets/styles/qfusionstyle_p_p.h index f0f00c4311..21d9d439a4 100644 --- a/src/widgets/styles/qfusionstyle_p_p.h +++ b/src/widgets/styles/qfusionstyle_p_p.h @@ -104,7 +104,7 @@ public: } QColor outline(const QPalette &pal) const { - if (!pal.window().texture().isNull()) + if (pal.window().style() == Qt::TexturePattern) return QColor(0, 0, 0, 160); return pal.background().color().darker(140); } @@ -117,7 +117,7 @@ public: } QColor tabFrameColor(const QPalette &pal) const { - if (!pal.button().texture().isNull()) + if (pal.window().style() == Qt::TexturePattern) return QColor(255, 255, 255, 8); return buttonColor(pal).lighter(104); } -- cgit v1.2.3