From ae0dd3201bc13b81c62752bb04e42362c78bfe16 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 30 Oct 2018 17:39:05 +0100 Subject: [Micro]optimization in QStyleSheetStyle::drawComplexControl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only copy QStyleOptionSlider when needed Change-Id: I9d9d8d40fa9ed8b7be4f6a32afa8bf68f64d7836 Reviewed-by: Christian Ehrlicher Reviewed-by: Sérgio Martins --- src/widgets/styles/qstylesheetstyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 3e397c9e04..121de548b0 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -3246,8 +3246,8 @@ void QStyleSheetStyle::drawComplexControl(ComplexControl cc, const QStyleOptionC #if QT_CONFIG(scrollbar) case CC_ScrollBar: if (const QStyleOptionSlider *sb = qstyleoption_cast(opt)) { - QStyleOptionSlider sbOpt(*sb); if (!rule.hasDrawable()) { + QStyleOptionSlider sbOpt(*sb); sbOpt.rect = rule.borderRect(opt->rect); rule.drawBackgroundImage(p, opt->rect); baseStyle()->drawComplexControl(cc, &sbOpt, p, w); -- cgit v1.2.3